@aurigma/axios-design-atoms-api-client 2.17.1
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.md +9 -0
- package/README.md +94 -0
- package/dist/cjs/design-atoms-api-client.d.ts +1139 -0
- package/dist/cjs/design-atoms-api-client.js +4215 -0
- package/dist/cjs/design-atoms-api-client.js.map +1 -0
- package/dist/esm/design-atoms-api-client.d.ts +1139 -0
- package/dist/esm/design-atoms-api-client.js +4205 -0
- package/dist/esm/design-atoms-api-client.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,4215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
//----------------------
|
|
5
|
+
// <auto-generated>
|
|
6
|
+
// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
|
|
7
|
+
// </auto-generated>
|
|
8
|
+
//----------------------
|
|
9
|
+
// ReSharper disable InconsistentNaming
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ItemSourceType = exports.ItemType = exports.ProductPatchType = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
12
|
+
const axios_1 = require("axios");
|
|
13
|
+
class ApiClientConfiguration {
|
|
14
|
+
apiUrl;
|
|
15
|
+
apiKey = '';
|
|
16
|
+
authorizationToken = null;
|
|
17
|
+
async getAuthorizationToken() { return this.authorizationToken; }
|
|
18
|
+
;
|
|
19
|
+
setAuthorizationToken(token) { this.authorizationToken = token; }
|
|
20
|
+
;
|
|
21
|
+
}
|
|
22
|
+
exports.ApiClientConfiguration = ApiClientConfiguration;
|
|
23
|
+
class ApiClientBase {
|
|
24
|
+
configuration;
|
|
25
|
+
constructor(configuration) {
|
|
26
|
+
this.configuration = configuration;
|
|
27
|
+
}
|
|
28
|
+
async transformOptions(options) {
|
|
29
|
+
const token = await this.configuration.getAuthorizationToken();
|
|
30
|
+
if (token != null) {
|
|
31
|
+
options.headers = { ...options.headers, authorization: ' Bearer ' + token };
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
options.headers = { ...options.headers, 'X-API-Key': this.configuration.apiKey };
|
|
35
|
+
}
|
|
36
|
+
options = { ...options, transformResponse: (res) => res, responseType: 'json' };
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
39
|
+
getBaseUrl(defultUrl) {
|
|
40
|
+
return this.configuration.apiUrl;
|
|
41
|
+
}
|
|
42
|
+
transformResult(url, res, cb) {
|
|
43
|
+
return cb(res);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.ApiClientBase = ApiClientBase;
|
|
47
|
+
class BuildInfoApiClient extends ApiClientBase {
|
|
48
|
+
instance;
|
|
49
|
+
baseUrl;
|
|
50
|
+
jsonParseReviver = undefined;
|
|
51
|
+
constructor(configuration, baseUrl, instance) {
|
|
52
|
+
super(configuration);
|
|
53
|
+
this.instance = instance ? instance : axios_1.default.create();
|
|
54
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Gets assembly build info
|
|
58
|
+
* @return Success
|
|
59
|
+
*/
|
|
60
|
+
headInfo(cancelToken) {
|
|
61
|
+
let url_ = this.baseUrl + "/api/atoms/v1/info";
|
|
62
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
63
|
+
let options_ = {
|
|
64
|
+
method: "HEAD",
|
|
65
|
+
url: url_,
|
|
66
|
+
headers: {},
|
|
67
|
+
cancelToken
|
|
68
|
+
};
|
|
69
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
70
|
+
return this.instance.request(transformedOptions_);
|
|
71
|
+
}).catch((_error) => {
|
|
72
|
+
if (isAxiosError(_error) && _error.response) {
|
|
73
|
+
return _error.response;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
throw _error;
|
|
77
|
+
}
|
|
78
|
+
}).then((_response) => {
|
|
79
|
+
return this.transformResult(url_, _response, (_response) => this.processHeadInfo(_response));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
processHeadInfo(response) {
|
|
83
|
+
const status = response.status;
|
|
84
|
+
let _headers = {};
|
|
85
|
+
if (response.headers && typeof response.headers === "object") {
|
|
86
|
+
for (let k in response.headers) {
|
|
87
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
88
|
+
_headers[k] = response.headers[k];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (status === 200) {
|
|
93
|
+
const _responseText = response.data;
|
|
94
|
+
return Promise.resolve(null);
|
|
95
|
+
}
|
|
96
|
+
else if (status !== 200 && status !== 204) {
|
|
97
|
+
const _responseText = response.data;
|
|
98
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
99
|
+
}
|
|
100
|
+
return Promise.resolve(null);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Gets assembly build info
|
|
104
|
+
* @return Success
|
|
105
|
+
*/
|
|
106
|
+
getInfo(cancelToken) {
|
|
107
|
+
let url_ = this.baseUrl + "/api/atoms/v1/info";
|
|
108
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
109
|
+
let options_ = {
|
|
110
|
+
method: "GET",
|
|
111
|
+
url: url_,
|
|
112
|
+
headers: {
|
|
113
|
+
"Accept": "application/json"
|
|
114
|
+
},
|
|
115
|
+
cancelToken
|
|
116
|
+
};
|
|
117
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
118
|
+
return this.instance.request(transformedOptions_);
|
|
119
|
+
}).catch((_error) => {
|
|
120
|
+
if (isAxiosError(_error) && _error.response) {
|
|
121
|
+
return _error.response;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
throw _error;
|
|
125
|
+
}
|
|
126
|
+
}).then((_response) => {
|
|
127
|
+
return this.transformResult(url_, _response, (_response) => this.processGetInfo(_response));
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
processGetInfo(response) {
|
|
131
|
+
const status = response.status;
|
|
132
|
+
let _headers = {};
|
|
133
|
+
if (response.headers && typeof response.headers === "object") {
|
|
134
|
+
for (let k in response.headers) {
|
|
135
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
136
|
+
_headers[k] = response.headers[k];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (status === 200) {
|
|
141
|
+
const _responseText = response.data;
|
|
142
|
+
let result200 = null;
|
|
143
|
+
let resultData200 = _responseText;
|
|
144
|
+
result200 = JSON.parse(resultData200);
|
|
145
|
+
return Promise.resolve(result200);
|
|
146
|
+
}
|
|
147
|
+
else if (status !== 200 && status !== 204) {
|
|
148
|
+
const _responseText = response.data;
|
|
149
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
150
|
+
}
|
|
151
|
+
return Promise.resolve(null);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.BuildInfoApiClient = BuildInfoApiClient;
|
|
155
|
+
class DesignAtomsCompatibilityApiClient extends ApiClientBase {
|
|
156
|
+
instance;
|
|
157
|
+
baseUrl;
|
|
158
|
+
jsonParseReviver = undefined;
|
|
159
|
+
constructor(configuration, baseUrl, instance) {
|
|
160
|
+
super(configuration);
|
|
161
|
+
this.instance = instance ? instance : axios_1.default.create();
|
|
162
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* @param body (optional)
|
|
166
|
+
* @return Success
|
|
167
|
+
*/
|
|
168
|
+
cssFonts(tenantId, body, cancelToken) {
|
|
169
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/cssfonts";
|
|
170
|
+
if (tenantId === undefined || tenantId === null)
|
|
171
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
172
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
173
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
174
|
+
const content_ = JSON.stringify(body);
|
|
175
|
+
let options_ = {
|
|
176
|
+
data: content_,
|
|
177
|
+
method: "POST",
|
|
178
|
+
url: url_,
|
|
179
|
+
headers: {
|
|
180
|
+
"Content-Type": "application/json",
|
|
181
|
+
"Accept": "application/json"
|
|
182
|
+
},
|
|
183
|
+
cancelToken
|
|
184
|
+
};
|
|
185
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
186
|
+
return this.instance.request(transformedOptions_);
|
|
187
|
+
}).catch((_error) => {
|
|
188
|
+
if (isAxiosError(_error) && _error.response) {
|
|
189
|
+
return _error.response;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
throw _error;
|
|
193
|
+
}
|
|
194
|
+
}).then((_response) => {
|
|
195
|
+
return this.transformResult(url_, _response, (_response) => this.processCssFonts(_response));
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
processCssFonts(response) {
|
|
199
|
+
const status = response.status;
|
|
200
|
+
let _headers = {};
|
|
201
|
+
if (response.headers && typeof response.headers === "object") {
|
|
202
|
+
for (let k in response.headers) {
|
|
203
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
204
|
+
_headers[k] = response.headers[k];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (status === 200) {
|
|
209
|
+
const _responseText = response.data;
|
|
210
|
+
let result200 = null;
|
|
211
|
+
let resultData200 = _responseText;
|
|
212
|
+
result200 = JSON.parse(resultData200);
|
|
213
|
+
return Promise.resolve(result200);
|
|
214
|
+
}
|
|
215
|
+
else if (status !== 200 && status !== 204) {
|
|
216
|
+
const _responseText = response.data;
|
|
217
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
218
|
+
}
|
|
219
|
+
return Promise.resolve(null);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* @return Success
|
|
223
|
+
*/
|
|
224
|
+
fonts(tenantId, psName, cancelToken) {
|
|
225
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/fonts/{psName}";
|
|
226
|
+
if (tenantId === undefined || tenantId === null)
|
|
227
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
228
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
229
|
+
if (psName === undefined || psName === null)
|
|
230
|
+
throw new Error("The parameter 'psName' must be defined.");
|
|
231
|
+
url_ = url_.replace("{psName}", encodeURIComponent("" + psName));
|
|
232
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
233
|
+
let options_ = {
|
|
234
|
+
responseType: "blob",
|
|
235
|
+
method: "GET",
|
|
236
|
+
url: url_,
|
|
237
|
+
headers: {
|
|
238
|
+
"Accept": "application/octet-stream"
|
|
239
|
+
},
|
|
240
|
+
cancelToken
|
|
241
|
+
};
|
|
242
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
243
|
+
return this.instance.request(transformedOptions_);
|
|
244
|
+
}).catch((_error) => {
|
|
245
|
+
if (isAxiosError(_error) && _error.response) {
|
|
246
|
+
return _error.response;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
throw _error;
|
|
250
|
+
}
|
|
251
|
+
}).then((_response) => {
|
|
252
|
+
return this.transformResult(url_, _response, (_response) => this.processFonts(_response));
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
processFonts(response) {
|
|
256
|
+
const status = response.status;
|
|
257
|
+
let _headers = {};
|
|
258
|
+
if (response.headers && typeof response.headers === "object") {
|
|
259
|
+
for (let k in response.headers) {
|
|
260
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
261
|
+
_headers[k] = response.headers[k];
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (status === 200 || status === 206) {
|
|
266
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
267
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
268
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
269
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
270
|
+
}
|
|
271
|
+
else if (status === 404) {
|
|
272
|
+
const _responseText = response.data;
|
|
273
|
+
let result404 = null;
|
|
274
|
+
let resultData404 = _responseText;
|
|
275
|
+
result404 = JSON.parse(resultData404);
|
|
276
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
277
|
+
}
|
|
278
|
+
else if (status !== 200 && status !== 204) {
|
|
279
|
+
const _responseText = response.data;
|
|
280
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
281
|
+
}
|
|
282
|
+
return Promise.resolve(null);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* @param fontKey (optional)
|
|
286
|
+
* @return Success
|
|
287
|
+
*/
|
|
288
|
+
getCssFont(tenantId, fontKey, cancelToken) {
|
|
289
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/GetCssFont?";
|
|
290
|
+
if (tenantId === undefined || tenantId === null)
|
|
291
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
292
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
293
|
+
if (fontKey !== undefined && fontKey !== null)
|
|
294
|
+
url_ += "fontKey=" + encodeURIComponent("" + fontKey) + "&";
|
|
295
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
296
|
+
let options_ = {
|
|
297
|
+
responseType: "blob",
|
|
298
|
+
method: "GET",
|
|
299
|
+
url: url_,
|
|
300
|
+
headers: {
|
|
301
|
+
"Accept": "application/json"
|
|
302
|
+
},
|
|
303
|
+
cancelToken
|
|
304
|
+
};
|
|
305
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
306
|
+
return this.instance.request(transformedOptions_);
|
|
307
|
+
}).catch((_error) => {
|
|
308
|
+
if (isAxiosError(_error) && _error.response) {
|
|
309
|
+
return _error.response;
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
throw _error;
|
|
313
|
+
}
|
|
314
|
+
}).then((_response) => {
|
|
315
|
+
return this.transformResult(url_, _response, (_response) => this.processGetCssFont(_response));
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
processGetCssFont(response) {
|
|
319
|
+
const status = response.status;
|
|
320
|
+
let _headers = {};
|
|
321
|
+
if (response.headers && typeof response.headers === "object") {
|
|
322
|
+
for (let k in response.headers) {
|
|
323
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
324
|
+
_headers[k] = response.headers[k];
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (status === 200 || status === 206) {
|
|
329
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
330
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
331
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
332
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
333
|
+
}
|
|
334
|
+
else if (status === 404) {
|
|
335
|
+
const _responseText = response.data;
|
|
336
|
+
let result404 = null;
|
|
337
|
+
let resultData404 = _responseText;
|
|
338
|
+
result404 = JSON.parse(resultData404);
|
|
339
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
340
|
+
}
|
|
341
|
+
else if (status !== 200 && status !== 204) {
|
|
342
|
+
const _responseText = response.data;
|
|
343
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
344
|
+
}
|
|
345
|
+
return Promise.resolve(null);
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* @param body (optional)
|
|
349
|
+
* @return Success
|
|
350
|
+
*/
|
|
351
|
+
getImageSize(tenantId, body, cancelToken) {
|
|
352
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/GetImageSize";
|
|
353
|
+
if (tenantId === undefined || tenantId === null)
|
|
354
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
355
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
356
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
357
|
+
const content_ = JSON.stringify(body);
|
|
358
|
+
let options_ = {
|
|
359
|
+
data: content_,
|
|
360
|
+
method: "POST",
|
|
361
|
+
url: url_,
|
|
362
|
+
headers: {
|
|
363
|
+
"Content-Type": "application/json",
|
|
364
|
+
"Accept": "application/json"
|
|
365
|
+
},
|
|
366
|
+
cancelToken
|
|
367
|
+
};
|
|
368
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
369
|
+
return this.instance.request(transformedOptions_);
|
|
370
|
+
}).catch((_error) => {
|
|
371
|
+
if (isAxiosError(_error) && _error.response) {
|
|
372
|
+
return _error.response;
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
throw _error;
|
|
376
|
+
}
|
|
377
|
+
}).then((_response) => {
|
|
378
|
+
return this.transformResult(url_, _response, (_response) => this.processGetImageSize(_response));
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
processGetImageSize(response) {
|
|
382
|
+
const status = response.status;
|
|
383
|
+
let _headers = {};
|
|
384
|
+
if (response.headers && typeof response.headers === "object") {
|
|
385
|
+
for (let k in response.headers) {
|
|
386
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
387
|
+
_headers[k] = response.headers[k];
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (status === 200) {
|
|
392
|
+
const _responseText = response.data;
|
|
393
|
+
let result200 = null;
|
|
394
|
+
let resultData200 = _responseText;
|
|
395
|
+
result200 = JSON.parse(resultData200);
|
|
396
|
+
return Promise.resolve(result200);
|
|
397
|
+
}
|
|
398
|
+
else if (status !== 200 && status !== 204) {
|
|
399
|
+
const _responseText = response.data;
|
|
400
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
401
|
+
}
|
|
402
|
+
return Promise.resolve(null);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* @param body (optional)
|
|
406
|
+
* @return Success
|
|
407
|
+
*/
|
|
408
|
+
getShapeBounds(tenantId, body, cancelToken) {
|
|
409
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/GetShapeBounds";
|
|
410
|
+
if (tenantId === undefined || tenantId === null)
|
|
411
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
412
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
413
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
414
|
+
const content_ = JSON.stringify(body);
|
|
415
|
+
let options_ = {
|
|
416
|
+
data: content_,
|
|
417
|
+
method: "POST",
|
|
418
|
+
url: url_,
|
|
419
|
+
headers: {
|
|
420
|
+
"Content-Type": "application/json",
|
|
421
|
+
"Accept": "application/json"
|
|
422
|
+
},
|
|
423
|
+
cancelToken
|
|
424
|
+
};
|
|
425
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
426
|
+
return this.instance.request(transformedOptions_);
|
|
427
|
+
}).catch((_error) => {
|
|
428
|
+
if (isAxiosError(_error) && _error.response) {
|
|
429
|
+
return _error.response;
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
throw _error;
|
|
433
|
+
}
|
|
434
|
+
}).then((_response) => {
|
|
435
|
+
return this.transformResult(url_, _response, (_response) => this.processGetShapeBounds(_response));
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
processGetShapeBounds(response) {
|
|
439
|
+
const status = response.status;
|
|
440
|
+
let _headers = {};
|
|
441
|
+
if (response.headers && typeof response.headers === "object") {
|
|
442
|
+
for (let k in response.headers) {
|
|
443
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
444
|
+
_headers[k] = response.headers[k];
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if (status === 200) {
|
|
449
|
+
const _responseText = response.data;
|
|
450
|
+
let result200 = null;
|
|
451
|
+
let resultData200 = _responseText;
|
|
452
|
+
result200 = JSON.parse(resultData200);
|
|
453
|
+
return Promise.resolve(result200);
|
|
454
|
+
}
|
|
455
|
+
else if (status !== 200 && status !== 204) {
|
|
456
|
+
const _responseText = response.data;
|
|
457
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
458
|
+
}
|
|
459
|
+
return Promise.resolve(null);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* @param body (optional)
|
|
463
|
+
* @return Success
|
|
464
|
+
*/
|
|
465
|
+
getWatermarkItems(tenantId, body, cancelToken) {
|
|
466
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/GetWatermarkItems";
|
|
467
|
+
if (tenantId === undefined || tenantId === null)
|
|
468
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
469
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
470
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
471
|
+
const content_ = JSON.stringify(body);
|
|
472
|
+
let options_ = {
|
|
473
|
+
data: content_,
|
|
474
|
+
method: "POST",
|
|
475
|
+
url: url_,
|
|
476
|
+
headers: {
|
|
477
|
+
"Content-Type": "application/json",
|
|
478
|
+
"Accept": "application/json"
|
|
479
|
+
},
|
|
480
|
+
cancelToken
|
|
481
|
+
};
|
|
482
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
483
|
+
return this.instance.request(transformedOptions_);
|
|
484
|
+
}).catch((_error) => {
|
|
485
|
+
if (isAxiosError(_error) && _error.response) {
|
|
486
|
+
return _error.response;
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
throw _error;
|
|
490
|
+
}
|
|
491
|
+
}).then((_response) => {
|
|
492
|
+
return this.transformResult(url_, _response, (_response) => this.processGetWatermarkItems(_response));
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
processGetWatermarkItems(response) {
|
|
496
|
+
const status = response.status;
|
|
497
|
+
let _headers = {};
|
|
498
|
+
if (response.headers && typeof response.headers === "object") {
|
|
499
|
+
for (let k in response.headers) {
|
|
500
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
501
|
+
_headers[k] = response.headers[k];
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
if (status === 200) {
|
|
506
|
+
const _responseText = response.data;
|
|
507
|
+
let result200 = null;
|
|
508
|
+
let resultData200 = _responseText;
|
|
509
|
+
result200 = JSON.parse(resultData200);
|
|
510
|
+
return Promise.resolve(result200);
|
|
511
|
+
}
|
|
512
|
+
else if (status !== 200 && status !== 204) {
|
|
513
|
+
const _responseText = response.data;
|
|
514
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
515
|
+
}
|
|
516
|
+
return Promise.resolve(null);
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* @param f (optional)
|
|
520
|
+
* @param w (optional)
|
|
521
|
+
* @param h (optional)
|
|
522
|
+
* @param cmyk (optional)
|
|
523
|
+
* @param rgb (optional)
|
|
524
|
+
* @param grayscale (optional)
|
|
525
|
+
* @param target (optional)
|
|
526
|
+
* @param sq (optional)
|
|
527
|
+
* @param effect (optional)
|
|
528
|
+
* @param kp (optional)
|
|
529
|
+
* @param color (optional)
|
|
530
|
+
* @param obm (optional)
|
|
531
|
+
* @param oo (optional)
|
|
532
|
+
* @param alphaMask (optional)
|
|
533
|
+
* @param page (optional)
|
|
534
|
+
* @param colorizeColor (optional)
|
|
535
|
+
* @return Success
|
|
536
|
+
*/
|
|
537
|
+
img(tenantId, f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, cancelToken) {
|
|
538
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/img?";
|
|
539
|
+
if (tenantId === undefined || tenantId === null)
|
|
540
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
541
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
542
|
+
if (f !== undefined && f !== null)
|
|
543
|
+
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
544
|
+
if (w !== undefined && w !== null)
|
|
545
|
+
url_ += "w=" + encodeURIComponent("" + w) + "&";
|
|
546
|
+
if (h !== undefined && h !== null)
|
|
547
|
+
url_ += "h=" + encodeURIComponent("" + h) + "&";
|
|
548
|
+
if (cmyk !== undefined && cmyk !== null)
|
|
549
|
+
url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
|
|
550
|
+
if (rgb !== undefined && rgb !== null)
|
|
551
|
+
url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
|
|
552
|
+
if (grayscale !== undefined && grayscale !== null)
|
|
553
|
+
url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
|
|
554
|
+
if (target !== undefined && target !== null)
|
|
555
|
+
url_ += "target=" + encodeURIComponent("" + target) + "&";
|
|
556
|
+
if (sq !== undefined && sq !== null)
|
|
557
|
+
url_ += "sq=" + encodeURIComponent("" + sq) + "&";
|
|
558
|
+
if (effect !== undefined && effect !== null)
|
|
559
|
+
url_ += "effect=" + encodeURIComponent("" + effect) + "&";
|
|
560
|
+
if (kp !== undefined && kp !== null)
|
|
561
|
+
url_ += "kp=" + encodeURIComponent("" + kp) + "&";
|
|
562
|
+
if (color !== undefined && color !== null)
|
|
563
|
+
url_ += "color=" + encodeURIComponent("" + color) + "&";
|
|
564
|
+
if (obm !== undefined && obm !== null)
|
|
565
|
+
url_ += "obm=" + encodeURIComponent("" + obm) + "&";
|
|
566
|
+
if (oo !== undefined && oo !== null)
|
|
567
|
+
url_ += "oo=" + encodeURIComponent("" + oo) + "&";
|
|
568
|
+
if (alphaMask !== undefined && alphaMask !== null)
|
|
569
|
+
url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
|
|
570
|
+
if (page !== undefined && page !== null)
|
|
571
|
+
url_ += "page=" + encodeURIComponent("" + page) + "&";
|
|
572
|
+
if (colorizeColor !== undefined && colorizeColor !== null)
|
|
573
|
+
url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
|
|
574
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
575
|
+
let options_ = {
|
|
576
|
+
responseType: "blob",
|
|
577
|
+
method: "GET",
|
|
578
|
+
url: url_,
|
|
579
|
+
headers: {
|
|
580
|
+
"Accept": "application/json"
|
|
581
|
+
},
|
|
582
|
+
cancelToken
|
|
583
|
+
};
|
|
584
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
585
|
+
return this.instance.request(transformedOptions_);
|
|
586
|
+
}).catch((_error) => {
|
|
587
|
+
if (isAxiosError(_error) && _error.response) {
|
|
588
|
+
return _error.response;
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
throw _error;
|
|
592
|
+
}
|
|
593
|
+
}).then((_response) => {
|
|
594
|
+
return this.transformResult(url_, _response, (_response) => this.processImg(_response));
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
processImg(response) {
|
|
598
|
+
const status = response.status;
|
|
599
|
+
let _headers = {};
|
|
600
|
+
if (response.headers && typeof response.headers === "object") {
|
|
601
|
+
for (let k in response.headers) {
|
|
602
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
603
|
+
_headers[k] = response.headers[k];
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
if (status === 200 || status === 206) {
|
|
608
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
609
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
610
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
611
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
612
|
+
}
|
|
613
|
+
else if (status === 304) {
|
|
614
|
+
const _responseText = response.data;
|
|
615
|
+
return throwException("Not Modified", status, _responseText, _headers);
|
|
616
|
+
}
|
|
617
|
+
else if (status === 404) {
|
|
618
|
+
const _responseText = response.data;
|
|
619
|
+
let result404 = null;
|
|
620
|
+
let resultData404 = _responseText;
|
|
621
|
+
result404 = JSON.parse(resultData404);
|
|
622
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
623
|
+
}
|
|
624
|
+
else if (status !== 200 && status !== 204) {
|
|
625
|
+
const _responseText = response.data;
|
|
626
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
627
|
+
}
|
|
628
|
+
return Promise.resolve(null);
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* @return Success
|
|
632
|
+
*/
|
|
633
|
+
getLicense(tenantId, cancelToken) {
|
|
634
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/license";
|
|
635
|
+
if (tenantId === undefined || tenantId === null)
|
|
636
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
637
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
638
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
639
|
+
let options_ = {
|
|
640
|
+
method: "GET",
|
|
641
|
+
url: url_,
|
|
642
|
+
headers: {
|
|
643
|
+
"Accept": "application/json"
|
|
644
|
+
},
|
|
645
|
+
cancelToken
|
|
646
|
+
};
|
|
647
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
648
|
+
return this.instance.request(transformedOptions_);
|
|
649
|
+
}).catch((_error) => {
|
|
650
|
+
if (isAxiosError(_error) && _error.response) {
|
|
651
|
+
return _error.response;
|
|
652
|
+
}
|
|
653
|
+
else {
|
|
654
|
+
throw _error;
|
|
655
|
+
}
|
|
656
|
+
}).then((_response) => {
|
|
657
|
+
return this.transformResult(url_, _response, (_response) => this.processGetLicense(_response));
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
processGetLicense(response) {
|
|
661
|
+
const status = response.status;
|
|
662
|
+
let _headers = {};
|
|
663
|
+
if (response.headers && typeof response.headers === "object") {
|
|
664
|
+
for (let k in response.headers) {
|
|
665
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
666
|
+
_headers[k] = response.headers[k];
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
if (status === 200) {
|
|
671
|
+
const _responseText = response.data;
|
|
672
|
+
let result200 = null;
|
|
673
|
+
let resultData200 = _responseText;
|
|
674
|
+
result200 = JSON.parse(resultData200);
|
|
675
|
+
return Promise.resolve(result200);
|
|
676
|
+
}
|
|
677
|
+
else if (status !== 200 && status !== 204) {
|
|
678
|
+
const _responseText = response.data;
|
|
679
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
680
|
+
}
|
|
681
|
+
return Promise.resolve(null);
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* @param f (optional)
|
|
685
|
+
* @return Success
|
|
686
|
+
*/
|
|
687
|
+
pth(tenantId, f, cancelToken) {
|
|
688
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/pth?";
|
|
689
|
+
if (tenantId === undefined || tenantId === null)
|
|
690
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
691
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
692
|
+
if (f !== undefined && f !== null)
|
|
693
|
+
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
694
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
695
|
+
let options_ = {
|
|
696
|
+
responseType: "blob",
|
|
697
|
+
method: "GET",
|
|
698
|
+
url: url_,
|
|
699
|
+
headers: {
|
|
700
|
+
"Accept": "application/json"
|
|
701
|
+
},
|
|
702
|
+
cancelToken
|
|
703
|
+
};
|
|
704
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
705
|
+
return this.instance.request(transformedOptions_);
|
|
706
|
+
}).catch((_error) => {
|
|
707
|
+
if (isAxiosError(_error) && _error.response) {
|
|
708
|
+
return _error.response;
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
throw _error;
|
|
712
|
+
}
|
|
713
|
+
}).then((_response) => {
|
|
714
|
+
return this.transformResult(url_, _response, (_response) => this.processPth(_response));
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
processPth(response) {
|
|
718
|
+
const status = response.status;
|
|
719
|
+
let _headers = {};
|
|
720
|
+
if (response.headers && typeof response.headers === "object") {
|
|
721
|
+
for (let k in response.headers) {
|
|
722
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
723
|
+
_headers[k] = response.headers[k];
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
if (status === 200 || status === 206) {
|
|
728
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
729
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
730
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
731
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
732
|
+
}
|
|
733
|
+
else if (status === 304) {
|
|
734
|
+
const _responseText = response.data;
|
|
735
|
+
return throwException("Not Modified", status, _responseText, _headers);
|
|
736
|
+
}
|
|
737
|
+
else if (status === 404) {
|
|
738
|
+
const _responseText = response.data;
|
|
739
|
+
let result404 = null;
|
|
740
|
+
let resultData404 = _responseText;
|
|
741
|
+
result404 = JSON.parse(resultData404);
|
|
742
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
743
|
+
}
|
|
744
|
+
else if (status !== 200 && status !== 204) {
|
|
745
|
+
const _responseText = response.data;
|
|
746
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
747
|
+
}
|
|
748
|
+
return Promise.resolve(null);
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* @param image (optional)
|
|
752
|
+
* @return Success
|
|
753
|
+
*/
|
|
754
|
+
resource(tenantId, image, cancelToken) {
|
|
755
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/resource?";
|
|
756
|
+
if (tenantId === undefined || tenantId === null)
|
|
757
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
758
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
759
|
+
if (image !== undefined && image !== null)
|
|
760
|
+
url_ += "image=" + encodeURIComponent("" + image) + "&";
|
|
761
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
762
|
+
let options_ = {
|
|
763
|
+
responseType: "blob",
|
|
764
|
+
method: "GET",
|
|
765
|
+
url: url_,
|
|
766
|
+
headers: {
|
|
767
|
+
"Accept": "application/json"
|
|
768
|
+
},
|
|
769
|
+
cancelToken
|
|
770
|
+
};
|
|
771
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
772
|
+
return this.instance.request(transformedOptions_);
|
|
773
|
+
}).catch((_error) => {
|
|
774
|
+
if (isAxiosError(_error) && _error.response) {
|
|
775
|
+
return _error.response;
|
|
776
|
+
}
|
|
777
|
+
else {
|
|
778
|
+
throw _error;
|
|
779
|
+
}
|
|
780
|
+
}).then((_response) => {
|
|
781
|
+
return this.transformResult(url_, _response, (_response) => this.processResource(_response));
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
processResource(response) {
|
|
785
|
+
const status = response.status;
|
|
786
|
+
let _headers = {};
|
|
787
|
+
if (response.headers && typeof response.headers === "object") {
|
|
788
|
+
for (let k in response.headers) {
|
|
789
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
790
|
+
_headers[k] = response.headers[k];
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
if (status === 200 || status === 206) {
|
|
795
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
796
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
797
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
798
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
799
|
+
}
|
|
800
|
+
else if (status === 404) {
|
|
801
|
+
const _responseText = response.data;
|
|
802
|
+
let result404 = null;
|
|
803
|
+
let resultData404 = _responseText;
|
|
804
|
+
result404 = JSON.parse(resultData404);
|
|
805
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
806
|
+
}
|
|
807
|
+
else if (status !== 200 && status !== 204) {
|
|
808
|
+
const _responseText = response.data;
|
|
809
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
810
|
+
}
|
|
811
|
+
return Promise.resolve(null);
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* @param f (optional)
|
|
815
|
+
* @return Success
|
|
816
|
+
*/
|
|
817
|
+
svg(tenantId, f, cancelToken) {
|
|
818
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/svg?";
|
|
819
|
+
if (tenantId === undefined || tenantId === null)
|
|
820
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
821
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
822
|
+
if (f !== undefined && f !== null)
|
|
823
|
+
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
824
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
825
|
+
let options_ = {
|
|
826
|
+
responseType: "blob",
|
|
827
|
+
method: "GET",
|
|
828
|
+
url: url_,
|
|
829
|
+
headers: {
|
|
830
|
+
"Accept": "application/json"
|
|
831
|
+
},
|
|
832
|
+
cancelToken
|
|
833
|
+
};
|
|
834
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
835
|
+
return this.instance.request(transformedOptions_);
|
|
836
|
+
}).catch((_error) => {
|
|
837
|
+
if (isAxiosError(_error) && _error.response) {
|
|
838
|
+
return _error.response;
|
|
839
|
+
}
|
|
840
|
+
else {
|
|
841
|
+
throw _error;
|
|
842
|
+
}
|
|
843
|
+
}).then((_response) => {
|
|
844
|
+
return this.transformResult(url_, _response, (_response) => this.processSvg(_response));
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
processSvg(response) {
|
|
848
|
+
const status = response.status;
|
|
849
|
+
let _headers = {};
|
|
850
|
+
if (response.headers && typeof response.headers === "object") {
|
|
851
|
+
for (let k in response.headers) {
|
|
852
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
853
|
+
_headers[k] = response.headers[k];
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
if (status === 200 || status === 206) {
|
|
858
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
859
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
860
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
861
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
862
|
+
}
|
|
863
|
+
else if (status === 304) {
|
|
864
|
+
const _responseText = response.data;
|
|
865
|
+
return throwException("Not Modified", status, _responseText, _headers);
|
|
866
|
+
}
|
|
867
|
+
else if (status === 404) {
|
|
868
|
+
const _responseText = response.data;
|
|
869
|
+
let result404 = null;
|
|
870
|
+
let resultData404 = _responseText;
|
|
871
|
+
result404 = JSON.parse(resultData404);
|
|
872
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
873
|
+
}
|
|
874
|
+
else if (status !== 200 && status !== 204) {
|
|
875
|
+
const _responseText = response.data;
|
|
876
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
877
|
+
}
|
|
878
|
+
return Promise.resolve(null);
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* @param f (optional)
|
|
882
|
+
* @return Success
|
|
883
|
+
*/
|
|
884
|
+
txt(tenantId, f, cancelToken) {
|
|
885
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/txt?";
|
|
886
|
+
if (tenantId === undefined || tenantId === null)
|
|
887
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
888
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
889
|
+
if (f !== undefined && f !== null)
|
|
890
|
+
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
891
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
892
|
+
let options_ = {
|
|
893
|
+
responseType: "blob",
|
|
894
|
+
method: "GET",
|
|
895
|
+
url: url_,
|
|
896
|
+
headers: {
|
|
897
|
+
"Accept": "application/json"
|
|
898
|
+
},
|
|
899
|
+
cancelToken
|
|
900
|
+
};
|
|
901
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
902
|
+
return this.instance.request(transformedOptions_);
|
|
903
|
+
}).catch((_error) => {
|
|
904
|
+
if (isAxiosError(_error) && _error.response) {
|
|
905
|
+
return _error.response;
|
|
906
|
+
}
|
|
907
|
+
else {
|
|
908
|
+
throw _error;
|
|
909
|
+
}
|
|
910
|
+
}).then((_response) => {
|
|
911
|
+
return this.transformResult(url_, _response, (_response) => this.processTxt(_response));
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
processTxt(response) {
|
|
915
|
+
const status = response.status;
|
|
916
|
+
let _headers = {};
|
|
917
|
+
if (response.headers && typeof response.headers === "object") {
|
|
918
|
+
for (let k in response.headers) {
|
|
919
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
920
|
+
_headers[k] = response.headers[k];
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
if (status === 200 || status === 206) {
|
|
925
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
926
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
927
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
928
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
929
|
+
}
|
|
930
|
+
else if (status === 304) {
|
|
931
|
+
const _responseText = response.data;
|
|
932
|
+
return throwException("Not Modified", status, _responseText, _headers);
|
|
933
|
+
}
|
|
934
|
+
else if (status === 404) {
|
|
935
|
+
const _responseText = response.data;
|
|
936
|
+
let result404 = null;
|
|
937
|
+
let resultData404 = _responseText;
|
|
938
|
+
result404 = JSON.parse(resultData404);
|
|
939
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
940
|
+
}
|
|
941
|
+
else if (status !== 200 && status !== 204) {
|
|
942
|
+
const _responseText = response.data;
|
|
943
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
944
|
+
}
|
|
945
|
+
return Promise.resolve(null);
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* @param body (optional)
|
|
949
|
+
* @return Success
|
|
950
|
+
*/
|
|
951
|
+
updateArchedTextItemHandler(tenantId, body, cancelToken) {
|
|
952
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdateArchedTextItemHandler";
|
|
953
|
+
if (tenantId === undefined || tenantId === null)
|
|
954
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
955
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
956
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
957
|
+
const content_ = JSON.stringify(body);
|
|
958
|
+
let options_ = {
|
|
959
|
+
data: content_,
|
|
960
|
+
method: "POST",
|
|
961
|
+
url: url_,
|
|
962
|
+
headers: {
|
|
963
|
+
"Content-Type": "application/json",
|
|
964
|
+
"Accept": "application/json"
|
|
965
|
+
},
|
|
966
|
+
cancelToken
|
|
967
|
+
};
|
|
968
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
969
|
+
return this.instance.request(transformedOptions_);
|
|
970
|
+
}).catch((_error) => {
|
|
971
|
+
if (isAxiosError(_error) && _error.response) {
|
|
972
|
+
return _error.response;
|
|
973
|
+
}
|
|
974
|
+
else {
|
|
975
|
+
throw _error;
|
|
976
|
+
}
|
|
977
|
+
}).then((_response) => {
|
|
978
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateArchedTextItemHandler(_response));
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
processUpdateArchedTextItemHandler(response) {
|
|
982
|
+
const status = response.status;
|
|
983
|
+
let _headers = {};
|
|
984
|
+
if (response.headers && typeof response.headers === "object") {
|
|
985
|
+
for (let k in response.headers) {
|
|
986
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
987
|
+
_headers[k] = response.headers[k];
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
if (status === 200) {
|
|
992
|
+
const _responseText = response.data;
|
|
993
|
+
let result200 = null;
|
|
994
|
+
let resultData200 = _responseText;
|
|
995
|
+
result200 = JSON.parse(resultData200);
|
|
996
|
+
return Promise.resolve(result200);
|
|
997
|
+
}
|
|
998
|
+
else if (status !== 200 && status !== 204) {
|
|
999
|
+
const _responseText = response.data;
|
|
1000
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1001
|
+
}
|
|
1002
|
+
return Promise.resolve(null);
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* @param body (optional)
|
|
1006
|
+
* @return Success
|
|
1007
|
+
*/
|
|
1008
|
+
updateAutoScaledTextItemHandler(tenantId, body, cancelToken) {
|
|
1009
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdateAutoScaledTextItemHandler";
|
|
1010
|
+
if (tenantId === undefined || tenantId === null)
|
|
1011
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1012
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1013
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1014
|
+
const content_ = JSON.stringify(body);
|
|
1015
|
+
let options_ = {
|
|
1016
|
+
data: content_,
|
|
1017
|
+
method: "POST",
|
|
1018
|
+
url: url_,
|
|
1019
|
+
headers: {
|
|
1020
|
+
"Content-Type": "application/json",
|
|
1021
|
+
"Accept": "application/json"
|
|
1022
|
+
},
|
|
1023
|
+
cancelToken
|
|
1024
|
+
};
|
|
1025
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1026
|
+
return this.instance.request(transformedOptions_);
|
|
1027
|
+
}).catch((_error) => {
|
|
1028
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1029
|
+
return _error.response;
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
throw _error;
|
|
1033
|
+
}
|
|
1034
|
+
}).then((_response) => {
|
|
1035
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateAutoScaledTextItemHandler(_response));
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
processUpdateAutoScaledTextItemHandler(response) {
|
|
1039
|
+
const status = response.status;
|
|
1040
|
+
let _headers = {};
|
|
1041
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1042
|
+
for (let k in response.headers) {
|
|
1043
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1044
|
+
_headers[k] = response.headers[k];
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
if (status === 200) {
|
|
1049
|
+
const _responseText = response.data;
|
|
1050
|
+
let result200 = null;
|
|
1051
|
+
let resultData200 = _responseText;
|
|
1052
|
+
result200 = JSON.parse(resultData200);
|
|
1053
|
+
return Promise.resolve(result200);
|
|
1054
|
+
}
|
|
1055
|
+
else if (status !== 200 && status !== 204) {
|
|
1056
|
+
const _responseText = response.data;
|
|
1057
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1058
|
+
}
|
|
1059
|
+
return Promise.resolve(null);
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* @param body (optional)
|
|
1063
|
+
* @return Success
|
|
1064
|
+
*/
|
|
1065
|
+
updateBarcodeItemHandler(tenantId, body, cancelToken) {
|
|
1066
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdateBarcodeItemHandler";
|
|
1067
|
+
if (tenantId === undefined || tenantId === null)
|
|
1068
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1069
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1070
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1071
|
+
const content_ = JSON.stringify(body);
|
|
1072
|
+
let options_ = {
|
|
1073
|
+
data: content_,
|
|
1074
|
+
method: "POST",
|
|
1075
|
+
url: url_,
|
|
1076
|
+
headers: {
|
|
1077
|
+
"Content-Type": "application/json",
|
|
1078
|
+
"Accept": "application/json"
|
|
1079
|
+
},
|
|
1080
|
+
cancelToken
|
|
1081
|
+
};
|
|
1082
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1083
|
+
return this.instance.request(transformedOptions_);
|
|
1084
|
+
}).catch((_error) => {
|
|
1085
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1086
|
+
return _error.response;
|
|
1087
|
+
}
|
|
1088
|
+
else {
|
|
1089
|
+
throw _error;
|
|
1090
|
+
}
|
|
1091
|
+
}).then((_response) => {
|
|
1092
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateBarcodeItemHandler(_response));
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
processUpdateBarcodeItemHandler(response) {
|
|
1096
|
+
const status = response.status;
|
|
1097
|
+
let _headers = {};
|
|
1098
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1099
|
+
for (let k in response.headers) {
|
|
1100
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1101
|
+
_headers[k] = response.headers[k];
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
if (status === 200) {
|
|
1106
|
+
const _responseText = response.data;
|
|
1107
|
+
let result200 = null;
|
|
1108
|
+
let resultData200 = _responseText;
|
|
1109
|
+
result200 = JSON.parse(resultData200);
|
|
1110
|
+
return Promise.resolve(result200);
|
|
1111
|
+
}
|
|
1112
|
+
else if (status !== 200 && status !== 204) {
|
|
1113
|
+
const _responseText = response.data;
|
|
1114
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1115
|
+
}
|
|
1116
|
+
return Promise.resolve(null);
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* @param body (optional)
|
|
1120
|
+
* @return Success
|
|
1121
|
+
*/
|
|
1122
|
+
updateBoundedTextItemHandler(tenantId, body, cancelToken) {
|
|
1123
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdateBoundedTextItemHandler";
|
|
1124
|
+
if (tenantId === undefined || tenantId === null)
|
|
1125
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1126
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1127
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1128
|
+
const content_ = JSON.stringify(body);
|
|
1129
|
+
let options_ = {
|
|
1130
|
+
data: content_,
|
|
1131
|
+
method: "POST",
|
|
1132
|
+
url: url_,
|
|
1133
|
+
headers: {
|
|
1134
|
+
"Content-Type": "application/json",
|
|
1135
|
+
"Accept": "application/json"
|
|
1136
|
+
},
|
|
1137
|
+
cancelToken
|
|
1138
|
+
};
|
|
1139
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1140
|
+
return this.instance.request(transformedOptions_);
|
|
1141
|
+
}).catch((_error) => {
|
|
1142
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1143
|
+
return _error.response;
|
|
1144
|
+
}
|
|
1145
|
+
else {
|
|
1146
|
+
throw _error;
|
|
1147
|
+
}
|
|
1148
|
+
}).then((_response) => {
|
|
1149
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateBoundedTextItemHandler(_response));
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
processUpdateBoundedTextItemHandler(response) {
|
|
1153
|
+
const status = response.status;
|
|
1154
|
+
let _headers = {};
|
|
1155
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1156
|
+
for (let k in response.headers) {
|
|
1157
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1158
|
+
_headers[k] = response.headers[k];
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
if (status === 200) {
|
|
1163
|
+
const _responseText = response.data;
|
|
1164
|
+
let result200 = null;
|
|
1165
|
+
let resultData200 = _responseText;
|
|
1166
|
+
result200 = JSON.parse(resultData200);
|
|
1167
|
+
return Promise.resolve(result200);
|
|
1168
|
+
}
|
|
1169
|
+
else if (status !== 200 && status !== 204) {
|
|
1170
|
+
const _responseText = response.data;
|
|
1171
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1172
|
+
}
|
|
1173
|
+
return Promise.resolve(null);
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* @param body (optional)
|
|
1177
|
+
* @return Success
|
|
1178
|
+
*/
|
|
1179
|
+
updateByColorData(tenantId, body, cancelToken) {
|
|
1180
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdateByColorData";
|
|
1181
|
+
if (tenantId === undefined || tenantId === null)
|
|
1182
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1183
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1184
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1185
|
+
const content_ = JSON.stringify(body);
|
|
1186
|
+
let options_ = {
|
|
1187
|
+
data: content_,
|
|
1188
|
+
method: "POST",
|
|
1189
|
+
url: url_,
|
|
1190
|
+
headers: {
|
|
1191
|
+
"Content-Type": "application/json",
|
|
1192
|
+
"Accept": "application/json"
|
|
1193
|
+
},
|
|
1194
|
+
cancelToken
|
|
1195
|
+
};
|
|
1196
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1197
|
+
return this.instance.request(transformedOptions_);
|
|
1198
|
+
}).catch((_error) => {
|
|
1199
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1200
|
+
return _error.response;
|
|
1201
|
+
}
|
|
1202
|
+
else {
|
|
1203
|
+
throw _error;
|
|
1204
|
+
}
|
|
1205
|
+
}).then((_response) => {
|
|
1206
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateByColorData(_response));
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
processUpdateByColorData(response) {
|
|
1210
|
+
const status = response.status;
|
|
1211
|
+
let _headers = {};
|
|
1212
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1213
|
+
for (let k in response.headers) {
|
|
1214
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1215
|
+
_headers[k] = response.headers[k];
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
if (status === 200) {
|
|
1220
|
+
const _responseText = response.data;
|
|
1221
|
+
let result200 = null;
|
|
1222
|
+
let resultData200 = _responseText;
|
|
1223
|
+
result200 = JSON.parse(resultData200);
|
|
1224
|
+
return Promise.resolve(result200);
|
|
1225
|
+
}
|
|
1226
|
+
else if (status !== 200 && status !== 204) {
|
|
1227
|
+
const _responseText = response.data;
|
|
1228
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1229
|
+
}
|
|
1230
|
+
return Promise.resolve(null);
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* @param body (optional)
|
|
1234
|
+
* @return Success
|
|
1235
|
+
*/
|
|
1236
|
+
updateByMultiCallRequest(tenantId, body, cancelToken) {
|
|
1237
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdateByMultiCallRequest";
|
|
1238
|
+
if (tenantId === undefined || tenantId === null)
|
|
1239
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1240
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1241
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1242
|
+
const content_ = JSON.stringify(body);
|
|
1243
|
+
let options_ = {
|
|
1244
|
+
data: content_,
|
|
1245
|
+
method: "POST",
|
|
1246
|
+
url: url_,
|
|
1247
|
+
headers: {
|
|
1248
|
+
"Content-Type": "application/json",
|
|
1249
|
+
"Accept": "application/json"
|
|
1250
|
+
},
|
|
1251
|
+
cancelToken
|
|
1252
|
+
};
|
|
1253
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1254
|
+
return this.instance.request(transformedOptions_);
|
|
1255
|
+
}).catch((_error) => {
|
|
1256
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1257
|
+
return _error.response;
|
|
1258
|
+
}
|
|
1259
|
+
else {
|
|
1260
|
+
throw _error;
|
|
1261
|
+
}
|
|
1262
|
+
}).then((_response) => {
|
|
1263
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateByMultiCallRequest(_response));
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
processUpdateByMultiCallRequest(response) {
|
|
1267
|
+
const status = response.status;
|
|
1268
|
+
let _headers = {};
|
|
1269
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1270
|
+
for (let k in response.headers) {
|
|
1271
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1272
|
+
_headers[k] = response.headers[k];
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
if (status === 200) {
|
|
1277
|
+
const _responseText = response.data;
|
|
1278
|
+
let result200 = null;
|
|
1279
|
+
let resultData200 = _responseText;
|
|
1280
|
+
result200 = JSON.parse(resultData200);
|
|
1281
|
+
return Promise.resolve(result200);
|
|
1282
|
+
}
|
|
1283
|
+
else if (status !== 200 && status !== 204) {
|
|
1284
|
+
const _responseText = response.data;
|
|
1285
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1286
|
+
}
|
|
1287
|
+
return Promise.resolve(null);
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* @param body (optional)
|
|
1291
|
+
* @return Success
|
|
1292
|
+
*/
|
|
1293
|
+
updateCurvedTextItemHandler(tenantId, body, cancelToken) {
|
|
1294
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdateCurvedTextItemHandler";
|
|
1295
|
+
if (tenantId === undefined || tenantId === null)
|
|
1296
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1297
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1298
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1299
|
+
const content_ = JSON.stringify(body);
|
|
1300
|
+
let options_ = {
|
|
1301
|
+
data: content_,
|
|
1302
|
+
method: "POST",
|
|
1303
|
+
url: url_,
|
|
1304
|
+
headers: {
|
|
1305
|
+
"Content-Type": "application/json",
|
|
1306
|
+
"Accept": "application/json"
|
|
1307
|
+
},
|
|
1308
|
+
cancelToken
|
|
1309
|
+
};
|
|
1310
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1311
|
+
return this.instance.request(transformedOptions_);
|
|
1312
|
+
}).catch((_error) => {
|
|
1313
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1314
|
+
return _error.response;
|
|
1315
|
+
}
|
|
1316
|
+
else {
|
|
1317
|
+
throw _error;
|
|
1318
|
+
}
|
|
1319
|
+
}).then((_response) => {
|
|
1320
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateCurvedTextItemHandler(_response));
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
processUpdateCurvedTextItemHandler(response) {
|
|
1324
|
+
const status = response.status;
|
|
1325
|
+
let _headers = {};
|
|
1326
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1327
|
+
for (let k in response.headers) {
|
|
1328
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1329
|
+
_headers[k] = response.headers[k];
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
if (status === 200) {
|
|
1334
|
+
const _responseText = response.data;
|
|
1335
|
+
let result200 = null;
|
|
1336
|
+
let resultData200 = _responseText;
|
|
1337
|
+
result200 = JSON.parse(resultData200);
|
|
1338
|
+
return Promise.resolve(result200);
|
|
1339
|
+
}
|
|
1340
|
+
else if (status !== 200 && status !== 204) {
|
|
1341
|
+
const _responseText = response.data;
|
|
1342
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1343
|
+
}
|
|
1344
|
+
return Promise.resolve(null);
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* @param body (optional)
|
|
1348
|
+
* @return Success
|
|
1349
|
+
*/
|
|
1350
|
+
updateImageItemHandler(tenantId, body, cancelToken) {
|
|
1351
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdateImageItemHandler";
|
|
1352
|
+
if (tenantId === undefined || tenantId === null)
|
|
1353
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1354
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1355
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1356
|
+
const content_ = JSON.stringify(body);
|
|
1357
|
+
let options_ = {
|
|
1358
|
+
data: content_,
|
|
1359
|
+
method: "POST",
|
|
1360
|
+
url: url_,
|
|
1361
|
+
headers: {
|
|
1362
|
+
"Content-Type": "application/json",
|
|
1363
|
+
"Accept": "application/json"
|
|
1364
|
+
},
|
|
1365
|
+
cancelToken
|
|
1366
|
+
};
|
|
1367
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1368
|
+
return this.instance.request(transformedOptions_);
|
|
1369
|
+
}).catch((_error) => {
|
|
1370
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1371
|
+
return _error.response;
|
|
1372
|
+
}
|
|
1373
|
+
else {
|
|
1374
|
+
throw _error;
|
|
1375
|
+
}
|
|
1376
|
+
}).then((_response) => {
|
|
1377
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateImageItemHandler(_response));
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
processUpdateImageItemHandler(response) {
|
|
1381
|
+
const status = response.status;
|
|
1382
|
+
let _headers = {};
|
|
1383
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1384
|
+
for (let k in response.headers) {
|
|
1385
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1386
|
+
_headers[k] = response.headers[k];
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
if (status === 200) {
|
|
1391
|
+
const _responseText = response.data;
|
|
1392
|
+
let result200 = null;
|
|
1393
|
+
let resultData200 = _responseText;
|
|
1394
|
+
result200 = JSON.parse(resultData200);
|
|
1395
|
+
return Promise.resolve(result200);
|
|
1396
|
+
}
|
|
1397
|
+
else if (status !== 200 && status !== 204) {
|
|
1398
|
+
const _responseText = response.data;
|
|
1399
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1400
|
+
}
|
|
1401
|
+
return Promise.resolve(null);
|
|
1402
|
+
}
|
|
1403
|
+
/**
|
|
1404
|
+
* @param body (optional)
|
|
1405
|
+
* @return Success
|
|
1406
|
+
*/
|
|
1407
|
+
updatePathBoundedTextItemHandler(tenantId, body, cancelToken) {
|
|
1408
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdatePathBoundedTextItemHandler";
|
|
1409
|
+
if (tenantId === undefined || tenantId === null)
|
|
1410
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1411
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1412
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1413
|
+
const content_ = JSON.stringify(body);
|
|
1414
|
+
let options_ = {
|
|
1415
|
+
data: content_,
|
|
1416
|
+
method: "POST",
|
|
1417
|
+
url: url_,
|
|
1418
|
+
headers: {
|
|
1419
|
+
"Content-Type": "application/json",
|
|
1420
|
+
"Accept": "application/json"
|
|
1421
|
+
},
|
|
1422
|
+
cancelToken
|
|
1423
|
+
};
|
|
1424
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1425
|
+
return this.instance.request(transformedOptions_);
|
|
1426
|
+
}).catch((_error) => {
|
|
1427
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1428
|
+
return _error.response;
|
|
1429
|
+
}
|
|
1430
|
+
else {
|
|
1431
|
+
throw _error;
|
|
1432
|
+
}
|
|
1433
|
+
}).then((_response) => {
|
|
1434
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdatePathBoundedTextItemHandler(_response));
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
processUpdatePathBoundedTextItemHandler(response) {
|
|
1438
|
+
const status = response.status;
|
|
1439
|
+
let _headers = {};
|
|
1440
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1441
|
+
for (let k in response.headers) {
|
|
1442
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1443
|
+
_headers[k] = response.headers[k];
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
if (status === 200) {
|
|
1448
|
+
const _responseText = response.data;
|
|
1449
|
+
let result200 = null;
|
|
1450
|
+
let resultData200 = _responseText;
|
|
1451
|
+
result200 = JSON.parse(resultData200);
|
|
1452
|
+
return Promise.resolve(result200);
|
|
1453
|
+
}
|
|
1454
|
+
else if (status !== 200 && status !== 204) {
|
|
1455
|
+
const _responseText = response.data;
|
|
1456
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1457
|
+
}
|
|
1458
|
+
return Promise.resolve(null);
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* @param body (optional)
|
|
1462
|
+
* @return Success
|
|
1463
|
+
*/
|
|
1464
|
+
updatePlainTextItemHandler(tenantId, body, cancelToken) {
|
|
1465
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdatePlainTextItemHandler";
|
|
1466
|
+
if (tenantId === undefined || tenantId === null)
|
|
1467
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1468
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1469
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1470
|
+
const content_ = JSON.stringify(body);
|
|
1471
|
+
let options_ = {
|
|
1472
|
+
data: content_,
|
|
1473
|
+
method: "POST",
|
|
1474
|
+
url: url_,
|
|
1475
|
+
headers: {
|
|
1476
|
+
"Content-Type": "application/json",
|
|
1477
|
+
"Accept": "application/json"
|
|
1478
|
+
},
|
|
1479
|
+
cancelToken
|
|
1480
|
+
};
|
|
1481
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1482
|
+
return this.instance.request(transformedOptions_);
|
|
1483
|
+
}).catch((_error) => {
|
|
1484
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1485
|
+
return _error.response;
|
|
1486
|
+
}
|
|
1487
|
+
else {
|
|
1488
|
+
throw _error;
|
|
1489
|
+
}
|
|
1490
|
+
}).then((_response) => {
|
|
1491
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdatePlainTextItemHandler(_response));
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
processUpdatePlainTextItemHandler(response) {
|
|
1495
|
+
const status = response.status;
|
|
1496
|
+
let _headers = {};
|
|
1497
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1498
|
+
for (let k in response.headers) {
|
|
1499
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1500
|
+
_headers[k] = response.headers[k];
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
if (status === 200) {
|
|
1505
|
+
const _responseText = response.data;
|
|
1506
|
+
let result200 = null;
|
|
1507
|
+
let resultData200 = _responseText;
|
|
1508
|
+
result200 = JSON.parse(resultData200);
|
|
1509
|
+
return Promise.resolve(result200);
|
|
1510
|
+
}
|
|
1511
|
+
else if (status !== 200 && status !== 204) {
|
|
1512
|
+
const _responseText = response.data;
|
|
1513
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1514
|
+
}
|
|
1515
|
+
return Promise.resolve(null);
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* @param body (optional)
|
|
1519
|
+
* @return Success
|
|
1520
|
+
*/
|
|
1521
|
+
updateShapeItemHandler(tenantId, body, cancelToken) {
|
|
1522
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/UpdateShapeItemHandler";
|
|
1523
|
+
if (tenantId === undefined || tenantId === null)
|
|
1524
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1525
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1526
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1527
|
+
const content_ = JSON.stringify(body);
|
|
1528
|
+
let options_ = {
|
|
1529
|
+
data: content_,
|
|
1530
|
+
method: "POST",
|
|
1531
|
+
url: url_,
|
|
1532
|
+
headers: {
|
|
1533
|
+
"Content-Type": "application/json",
|
|
1534
|
+
"Accept": "application/json"
|
|
1535
|
+
},
|
|
1536
|
+
cancelToken
|
|
1537
|
+
};
|
|
1538
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1539
|
+
return this.instance.request(transformedOptions_);
|
|
1540
|
+
}).catch((_error) => {
|
|
1541
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1542
|
+
return _error.response;
|
|
1543
|
+
}
|
|
1544
|
+
else {
|
|
1545
|
+
throw _error;
|
|
1546
|
+
}
|
|
1547
|
+
}).then((_response) => {
|
|
1548
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateShapeItemHandler(_response));
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
processUpdateShapeItemHandler(response) {
|
|
1552
|
+
const status = response.status;
|
|
1553
|
+
let _headers = {};
|
|
1554
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1555
|
+
for (let k in response.headers) {
|
|
1556
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1557
|
+
_headers[k] = response.headers[k];
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
if (status === 200) {
|
|
1562
|
+
const _responseText = response.data;
|
|
1563
|
+
let result200 = null;
|
|
1564
|
+
let resultData200 = _responseText;
|
|
1565
|
+
result200 = JSON.parse(resultData200);
|
|
1566
|
+
return Promise.resolve(result200);
|
|
1567
|
+
}
|
|
1568
|
+
else if (status !== 200 && status !== 204) {
|
|
1569
|
+
const _responseText = response.data;
|
|
1570
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1571
|
+
}
|
|
1572
|
+
return Promise.resolve(null);
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
exports.DesignAtomsCompatibilityApiClient = DesignAtomsCompatibilityApiClient;
|
|
1576
|
+
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
1577
|
+
instance;
|
|
1578
|
+
baseUrl;
|
|
1579
|
+
jsonParseReviver = undefined;
|
|
1580
|
+
constructor(configuration, baseUrl, instance) {
|
|
1581
|
+
super(configuration);
|
|
1582
|
+
this.instance = instance ? instance : axios_1.default.create();
|
|
1583
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Converts colors
|
|
1587
|
+
* @param tenantId (optional) Tenant identifier
|
|
1588
|
+
* @param body (optional) Convert colors operation parameters
|
|
1589
|
+
* @return Success
|
|
1590
|
+
*/
|
|
1591
|
+
convertColors(tenantId, body, cancelToken) {
|
|
1592
|
+
let url_ = this.baseUrl + "/api/atoms/v1/colorConverter?";
|
|
1593
|
+
if (tenantId === null)
|
|
1594
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1595
|
+
else if (tenantId !== undefined)
|
|
1596
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1597
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1598
|
+
const content_ = JSON.stringify(body);
|
|
1599
|
+
let options_ = {
|
|
1600
|
+
data: content_,
|
|
1601
|
+
method: "POST",
|
|
1602
|
+
url: url_,
|
|
1603
|
+
headers: {
|
|
1604
|
+
"Content-Type": "application/json",
|
|
1605
|
+
"Accept": "application/json"
|
|
1606
|
+
},
|
|
1607
|
+
cancelToken
|
|
1608
|
+
};
|
|
1609
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1610
|
+
return this.instance.request(transformedOptions_);
|
|
1611
|
+
}).catch((_error) => {
|
|
1612
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1613
|
+
return _error.response;
|
|
1614
|
+
}
|
|
1615
|
+
else {
|
|
1616
|
+
throw _error;
|
|
1617
|
+
}
|
|
1618
|
+
}).then((_response) => {
|
|
1619
|
+
return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
processConvertColors(response) {
|
|
1623
|
+
const status = response.status;
|
|
1624
|
+
let _headers = {};
|
|
1625
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1626
|
+
for (let k in response.headers) {
|
|
1627
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1628
|
+
_headers[k] = response.headers[k];
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
if (status === 200) {
|
|
1633
|
+
const _responseText = response.data;
|
|
1634
|
+
let result200 = null;
|
|
1635
|
+
let resultData200 = _responseText;
|
|
1636
|
+
result200 = JSON.parse(resultData200);
|
|
1637
|
+
return Promise.resolve(result200);
|
|
1638
|
+
}
|
|
1639
|
+
else if (status === 404) {
|
|
1640
|
+
const _responseText = response.data;
|
|
1641
|
+
let result404 = null;
|
|
1642
|
+
let resultData404 = _responseText;
|
|
1643
|
+
result404 = JSON.parse(resultData404);
|
|
1644
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1645
|
+
}
|
|
1646
|
+
else if (status === 401) {
|
|
1647
|
+
const _responseText = response.data;
|
|
1648
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1649
|
+
}
|
|
1650
|
+
else if (status === 403) {
|
|
1651
|
+
const _responseText = response.data;
|
|
1652
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1653
|
+
}
|
|
1654
|
+
else if (status !== 200 && status !== 204) {
|
|
1655
|
+
const _responseText = response.data;
|
|
1656
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1657
|
+
}
|
|
1658
|
+
return Promise.resolve(null);
|
|
1659
|
+
}
|
|
1660
|
+
/**
|
|
1661
|
+
* Creates new design file with specified parameters and saves it in storage.
|
|
1662
|
+
* @param privateStorage (optional) If set to 'true' design will be saved to private storage
|
|
1663
|
+
* @param privateStorageOwner (optional) Private storage owner identifier
|
|
1664
|
+
* @param tenantId (optional) Tenant identifier
|
|
1665
|
+
* @param body (optional) Design creation parameters
|
|
1666
|
+
* @return Success
|
|
1667
|
+
*/
|
|
1668
|
+
createDesign(privateStorage, privateStorageOwner, tenantId, body, cancelToken) {
|
|
1669
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
1670
|
+
if (privateStorage !== undefined && privateStorage !== null)
|
|
1671
|
+
url_ += "privateStorage=" + encodeURIComponent("" + privateStorage) + "&";
|
|
1672
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
1673
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
1674
|
+
if (tenantId === null)
|
|
1675
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1676
|
+
else if (tenantId !== undefined)
|
|
1677
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1678
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1679
|
+
const content_ = JSON.stringify(body);
|
|
1680
|
+
let options_ = {
|
|
1681
|
+
data: content_,
|
|
1682
|
+
method: "POST",
|
|
1683
|
+
url: url_,
|
|
1684
|
+
headers: {
|
|
1685
|
+
"Content-Type": "application/json",
|
|
1686
|
+
"Accept": "application/json"
|
|
1687
|
+
},
|
|
1688
|
+
cancelToken
|
|
1689
|
+
};
|
|
1690
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1691
|
+
return this.instance.request(transformedOptions_);
|
|
1692
|
+
}).catch((_error) => {
|
|
1693
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1694
|
+
return _error.response;
|
|
1695
|
+
}
|
|
1696
|
+
else {
|
|
1697
|
+
throw _error;
|
|
1698
|
+
}
|
|
1699
|
+
}).then((_response) => {
|
|
1700
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateDesign(_response));
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1703
|
+
processCreateDesign(response) {
|
|
1704
|
+
const status = response.status;
|
|
1705
|
+
let _headers = {};
|
|
1706
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1707
|
+
for (let k in response.headers) {
|
|
1708
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1709
|
+
_headers[k] = response.headers[k];
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
if (status === 201) {
|
|
1714
|
+
const _responseText = response.data;
|
|
1715
|
+
let result201 = null;
|
|
1716
|
+
let resultData201 = _responseText;
|
|
1717
|
+
result201 = JSON.parse(resultData201);
|
|
1718
|
+
return Promise.resolve(result201);
|
|
1719
|
+
}
|
|
1720
|
+
else if (status === 401) {
|
|
1721
|
+
const _responseText = response.data;
|
|
1722
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1723
|
+
}
|
|
1724
|
+
else if (status === 403) {
|
|
1725
|
+
const _responseText = response.data;
|
|
1726
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1727
|
+
}
|
|
1728
|
+
else if (status !== 200 && status !== 204) {
|
|
1729
|
+
const _responseText = response.data;
|
|
1730
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1731
|
+
}
|
|
1732
|
+
return Promise.resolve(null);
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* Loads product (design model) from design file taken from storage
|
|
1736
|
+
* @param id Design identifier
|
|
1737
|
+
* @param privateStorage (optional) If set to 'true' design will be taken from private storage
|
|
1738
|
+
* @param privateStorageOwner (optional) Private storage owner identifier
|
|
1739
|
+
* @param tenantId (optional) Tenant identifier
|
|
1740
|
+
* @return Success
|
|
1741
|
+
*/
|
|
1742
|
+
loadProduct(id, privateStorage, privateStorageOwner, tenantId, cancelToken) {
|
|
1743
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
1744
|
+
if (id === undefined || id === null)
|
|
1745
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1746
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1747
|
+
if (privateStorage !== undefined && privateStorage !== null)
|
|
1748
|
+
url_ += "privateStorage=" + encodeURIComponent("" + privateStorage) + "&";
|
|
1749
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
1750
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
1751
|
+
if (tenantId === null)
|
|
1752
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1753
|
+
else if (tenantId !== undefined)
|
|
1754
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1755
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1756
|
+
let options_ = {
|
|
1757
|
+
method: "GET",
|
|
1758
|
+
url: url_,
|
|
1759
|
+
headers: {
|
|
1760
|
+
"Accept": "application/json"
|
|
1761
|
+
},
|
|
1762
|
+
cancelToken
|
|
1763
|
+
};
|
|
1764
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1765
|
+
return this.instance.request(transformedOptions_);
|
|
1766
|
+
}).catch((_error) => {
|
|
1767
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1768
|
+
return _error.response;
|
|
1769
|
+
}
|
|
1770
|
+
else {
|
|
1771
|
+
throw _error;
|
|
1772
|
+
}
|
|
1773
|
+
}).then((_response) => {
|
|
1774
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
processLoadProduct(response) {
|
|
1778
|
+
const status = response.status;
|
|
1779
|
+
let _headers = {};
|
|
1780
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1781
|
+
for (let k in response.headers) {
|
|
1782
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1783
|
+
_headers[k] = response.headers[k];
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
if (status === 200) {
|
|
1788
|
+
const _responseText = response.data;
|
|
1789
|
+
let result200 = null;
|
|
1790
|
+
let resultData200 = _responseText;
|
|
1791
|
+
result200 = JSON.parse(resultData200);
|
|
1792
|
+
return Promise.resolve(result200);
|
|
1793
|
+
}
|
|
1794
|
+
else if (status === 404) {
|
|
1795
|
+
const _responseText = response.data;
|
|
1796
|
+
let result404 = null;
|
|
1797
|
+
let resultData404 = _responseText;
|
|
1798
|
+
result404 = JSON.parse(resultData404);
|
|
1799
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1800
|
+
}
|
|
1801
|
+
else if (status === 401) {
|
|
1802
|
+
const _responseText = response.data;
|
|
1803
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1804
|
+
}
|
|
1805
|
+
else if (status === 403) {
|
|
1806
|
+
const _responseText = response.data;
|
|
1807
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1808
|
+
}
|
|
1809
|
+
else if (status !== 200 && status !== 204) {
|
|
1810
|
+
const _responseText = response.data;
|
|
1811
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1812
|
+
}
|
|
1813
|
+
return Promise.resolve(null);
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Saves product (design model) to design file and updates design in storage.
|
|
1817
|
+
* @param id Design identifier
|
|
1818
|
+
* @param privateStorage (optional) If set to 'true' design will be saved to private storage
|
|
1819
|
+
* @param privateStorageOwner (optional) Private storage owner identifier
|
|
1820
|
+
* @param tenantId (optional) Tenant identifier
|
|
1821
|
+
* @param body (optional) Serialized product description
|
|
1822
|
+
* @return Success
|
|
1823
|
+
*/
|
|
1824
|
+
saveProduct(id, privateStorage, privateStorageOwner, tenantId, body, cancelToken) {
|
|
1825
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
1826
|
+
if (id === undefined || id === null)
|
|
1827
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1828
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1829
|
+
if (privateStorage !== undefined && privateStorage !== null)
|
|
1830
|
+
url_ += "privateStorage=" + encodeURIComponent("" + privateStorage) + "&";
|
|
1831
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
1832
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
1833
|
+
if (tenantId === null)
|
|
1834
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1835
|
+
else if (tenantId !== undefined)
|
|
1836
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1837
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1838
|
+
const content_ = JSON.stringify(body);
|
|
1839
|
+
let options_ = {
|
|
1840
|
+
data: content_,
|
|
1841
|
+
method: "PUT",
|
|
1842
|
+
url: url_,
|
|
1843
|
+
headers: {
|
|
1844
|
+
"Content-Type": "application/json",
|
|
1845
|
+
},
|
|
1846
|
+
cancelToken
|
|
1847
|
+
};
|
|
1848
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1849
|
+
return this.instance.request(transformedOptions_);
|
|
1850
|
+
}).catch((_error) => {
|
|
1851
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1852
|
+
return _error.response;
|
|
1853
|
+
}
|
|
1854
|
+
else {
|
|
1855
|
+
throw _error;
|
|
1856
|
+
}
|
|
1857
|
+
}).then((_response) => {
|
|
1858
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
|
|
1859
|
+
});
|
|
1860
|
+
}
|
|
1861
|
+
processSaveProduct(response) {
|
|
1862
|
+
const status = response.status;
|
|
1863
|
+
let _headers = {};
|
|
1864
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1865
|
+
for (let k in response.headers) {
|
|
1866
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1867
|
+
_headers[k] = response.headers[k];
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
if (status === 200) {
|
|
1872
|
+
const _responseText = response.data;
|
|
1873
|
+
return Promise.resolve(null);
|
|
1874
|
+
}
|
|
1875
|
+
else if (status === 404) {
|
|
1876
|
+
const _responseText = response.data;
|
|
1877
|
+
let result404 = null;
|
|
1878
|
+
let resultData404 = _responseText;
|
|
1879
|
+
result404 = JSON.parse(resultData404);
|
|
1880
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1881
|
+
}
|
|
1882
|
+
else if (status === 401) {
|
|
1883
|
+
const _responseText = response.data;
|
|
1884
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1885
|
+
}
|
|
1886
|
+
else if (status === 403) {
|
|
1887
|
+
const _responseText = response.data;
|
|
1888
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1889
|
+
}
|
|
1890
|
+
else if (status !== 200 && status !== 204) {
|
|
1891
|
+
const _responseText = response.data;
|
|
1892
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1893
|
+
}
|
|
1894
|
+
return Promise.resolve(null);
|
|
1895
|
+
}
|
|
1896
|
+
/**
|
|
1897
|
+
* Patches product (design model) in design file
|
|
1898
|
+
* @param id Design identifier
|
|
1899
|
+
* @param tenantId (optional) Tenant identifier
|
|
1900
|
+
* @param patchType (optional)
|
|
1901
|
+
* @param replaceImageItemFileInfo_itemName (optional)
|
|
1902
|
+
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
1903
|
+
* @return Success
|
|
1904
|
+
*/
|
|
1905
|
+
patchProduct(id, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, cancelToken) {
|
|
1906
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
1907
|
+
if (id === undefined || id === null)
|
|
1908
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1909
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1910
|
+
if (tenantId === null)
|
|
1911
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1912
|
+
else if (tenantId !== undefined)
|
|
1913
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1914
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1915
|
+
const content_ = new FormData();
|
|
1916
|
+
if (patchType === null || patchType === undefined)
|
|
1917
|
+
throw new Error("The parameter 'patchType' cannot be null.");
|
|
1918
|
+
else
|
|
1919
|
+
content_.append("patchType", patchType.toString());
|
|
1920
|
+
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
1921
|
+
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
1922
|
+
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
1923
|
+
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
1924
|
+
let options_ = {
|
|
1925
|
+
data: content_,
|
|
1926
|
+
method: "PATCH",
|
|
1927
|
+
url: url_,
|
|
1928
|
+
headers: {},
|
|
1929
|
+
cancelToken
|
|
1930
|
+
};
|
|
1931
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1932
|
+
return this.instance.request(transformedOptions_);
|
|
1933
|
+
}).catch((_error) => {
|
|
1934
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1935
|
+
return _error.response;
|
|
1936
|
+
}
|
|
1937
|
+
else {
|
|
1938
|
+
throw _error;
|
|
1939
|
+
}
|
|
1940
|
+
}).then((_response) => {
|
|
1941
|
+
return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
processPatchProduct(response) {
|
|
1945
|
+
const status = response.status;
|
|
1946
|
+
let _headers = {};
|
|
1947
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1948
|
+
for (let k in response.headers) {
|
|
1949
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1950
|
+
_headers[k] = response.headers[k];
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
if (status === 200) {
|
|
1955
|
+
const _responseText = response.data;
|
|
1956
|
+
return Promise.resolve(null);
|
|
1957
|
+
}
|
|
1958
|
+
else if (status === 404) {
|
|
1959
|
+
const _responseText = response.data;
|
|
1960
|
+
let result404 = null;
|
|
1961
|
+
let resultData404 = _responseText;
|
|
1962
|
+
result404 = JSON.parse(resultData404);
|
|
1963
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1964
|
+
}
|
|
1965
|
+
else if (status === 401) {
|
|
1966
|
+
const _responseText = response.data;
|
|
1967
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1968
|
+
}
|
|
1969
|
+
else if (status === 403) {
|
|
1970
|
+
const _responseText = response.data;
|
|
1971
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1972
|
+
}
|
|
1973
|
+
else if (status !== 200 && status !== 204) {
|
|
1974
|
+
const _responseText = response.data;
|
|
1975
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1976
|
+
}
|
|
1977
|
+
return Promise.resolve(null);
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Loads data schema from design file taken from storage
|
|
1981
|
+
* @param id Design identifier
|
|
1982
|
+
* @param tenantId (optional) Tenant identifier
|
|
1983
|
+
* @return Success
|
|
1984
|
+
*/
|
|
1985
|
+
loadDataSchema(id, tenantId, cancelToken) {
|
|
1986
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
|
|
1987
|
+
if (id === undefined || id === null)
|
|
1988
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1989
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1990
|
+
if (tenantId === null)
|
|
1991
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1992
|
+
else if (tenantId !== undefined)
|
|
1993
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1994
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1995
|
+
let options_ = {
|
|
1996
|
+
responseType: "blob",
|
|
1997
|
+
method: "GET",
|
|
1998
|
+
url: url_,
|
|
1999
|
+
headers: {
|
|
2000
|
+
"Accept": "application/octet-stream"
|
|
2001
|
+
},
|
|
2002
|
+
cancelToken
|
|
2003
|
+
};
|
|
2004
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2005
|
+
return this.instance.request(transformedOptions_);
|
|
2006
|
+
}).catch((_error) => {
|
|
2007
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2008
|
+
return _error.response;
|
|
2009
|
+
}
|
|
2010
|
+
else {
|
|
2011
|
+
throw _error;
|
|
2012
|
+
}
|
|
2013
|
+
}).then((_response) => {
|
|
2014
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
|
|
2015
|
+
});
|
|
2016
|
+
}
|
|
2017
|
+
processLoadDataSchema(response) {
|
|
2018
|
+
const status = response.status;
|
|
2019
|
+
let _headers = {};
|
|
2020
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2021
|
+
for (let k in response.headers) {
|
|
2022
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2023
|
+
_headers[k] = response.headers[k];
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
if (status === 200 || status === 206) {
|
|
2028
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2029
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2030
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2031
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2032
|
+
}
|
|
2033
|
+
else if (status === 404) {
|
|
2034
|
+
const _responseText = response.data;
|
|
2035
|
+
let result404 = null;
|
|
2036
|
+
let resultData404 = _responseText;
|
|
2037
|
+
result404 = JSON.parse(resultData404);
|
|
2038
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2039
|
+
}
|
|
2040
|
+
else if (status === 409) {
|
|
2041
|
+
const _responseText = response.data;
|
|
2042
|
+
let result409 = null;
|
|
2043
|
+
let resultData409 = _responseText;
|
|
2044
|
+
result409 = JSON.parse(resultData409);
|
|
2045
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2046
|
+
}
|
|
2047
|
+
else if (status === 401) {
|
|
2048
|
+
const _responseText = response.data;
|
|
2049
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2050
|
+
}
|
|
2051
|
+
else if (status === 403) {
|
|
2052
|
+
const _responseText = response.data;
|
|
2053
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2054
|
+
}
|
|
2055
|
+
else if (status !== 200 && status !== 204) {
|
|
2056
|
+
const _responseText = response.data;
|
|
2057
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2058
|
+
}
|
|
2059
|
+
return Promise.resolve(null);
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* Gets variable items information for design file taken from storage
|
|
2063
|
+
* @param id Design identifier
|
|
2064
|
+
* @param tenantId (optional) Tenant identifier
|
|
2065
|
+
* @return Success
|
|
2066
|
+
*/
|
|
2067
|
+
getVariables(id, tenantId, cancelToken) {
|
|
2068
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2069
|
+
if (id === undefined || id === null)
|
|
2070
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2071
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2072
|
+
if (tenantId === null)
|
|
2073
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2074
|
+
else if (tenantId !== undefined)
|
|
2075
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2076
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2077
|
+
let options_ = {
|
|
2078
|
+
method: "GET",
|
|
2079
|
+
url: url_,
|
|
2080
|
+
headers: {
|
|
2081
|
+
"Accept": "application/json"
|
|
2082
|
+
},
|
|
2083
|
+
cancelToken
|
|
2084
|
+
};
|
|
2085
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2086
|
+
return this.instance.request(transformedOptions_);
|
|
2087
|
+
}).catch((_error) => {
|
|
2088
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2089
|
+
return _error.response;
|
|
2090
|
+
}
|
|
2091
|
+
else {
|
|
2092
|
+
throw _error;
|
|
2093
|
+
}
|
|
2094
|
+
}).then((_response) => {
|
|
2095
|
+
return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
2098
|
+
processGetVariables(response) {
|
|
2099
|
+
const status = response.status;
|
|
2100
|
+
let _headers = {};
|
|
2101
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2102
|
+
for (let k in response.headers) {
|
|
2103
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2104
|
+
_headers[k] = response.headers[k];
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
if (status === 200) {
|
|
2109
|
+
const _responseText = response.data;
|
|
2110
|
+
let result200 = null;
|
|
2111
|
+
let resultData200 = _responseText;
|
|
2112
|
+
result200 = JSON.parse(resultData200);
|
|
2113
|
+
return Promise.resolve(result200);
|
|
2114
|
+
}
|
|
2115
|
+
else if (status === 404) {
|
|
2116
|
+
const _responseText = response.data;
|
|
2117
|
+
let result404 = null;
|
|
2118
|
+
let resultData404 = _responseText;
|
|
2119
|
+
result404 = JSON.parse(resultData404);
|
|
2120
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2121
|
+
}
|
|
2122
|
+
else if (status === 401) {
|
|
2123
|
+
const _responseText = response.data;
|
|
2124
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2125
|
+
}
|
|
2126
|
+
else if (status === 403) {
|
|
2127
|
+
const _responseText = response.data;
|
|
2128
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2129
|
+
}
|
|
2130
|
+
else if (status !== 200 && status !== 204) {
|
|
2131
|
+
const _responseText = response.data;
|
|
2132
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2133
|
+
}
|
|
2134
|
+
return Promise.resolve(null);
|
|
2135
|
+
}
|
|
2136
|
+
/**
|
|
2137
|
+
* Sets variable items values for design file taken from storage
|
|
2138
|
+
* @param id Design identifier
|
|
2139
|
+
* @param tenantId (optional) Tenant identifier
|
|
2140
|
+
* @param body (optional) Design variable values
|
|
2141
|
+
* @return Success
|
|
2142
|
+
*/
|
|
2143
|
+
setVariables(id, tenantId, body, cancelToken) {
|
|
2144
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2145
|
+
if (id === undefined || id === null)
|
|
2146
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2147
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2148
|
+
if (tenantId === null)
|
|
2149
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2150
|
+
else if (tenantId !== undefined)
|
|
2151
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2152
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2153
|
+
const content_ = JSON.stringify(body);
|
|
2154
|
+
let options_ = {
|
|
2155
|
+
data: content_,
|
|
2156
|
+
method: "PUT",
|
|
2157
|
+
url: url_,
|
|
2158
|
+
headers: {
|
|
2159
|
+
"Content-Type": "application/json",
|
|
2160
|
+
"Accept": "application/json"
|
|
2161
|
+
},
|
|
2162
|
+
cancelToken
|
|
2163
|
+
};
|
|
2164
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2165
|
+
return this.instance.request(transformedOptions_);
|
|
2166
|
+
}).catch((_error) => {
|
|
2167
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2168
|
+
return _error.response;
|
|
2169
|
+
}
|
|
2170
|
+
else {
|
|
2171
|
+
throw _error;
|
|
2172
|
+
}
|
|
2173
|
+
}).then((_response) => {
|
|
2174
|
+
return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
processSetVariables(response) {
|
|
2178
|
+
const status = response.status;
|
|
2179
|
+
let _headers = {};
|
|
2180
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2181
|
+
for (let k in response.headers) {
|
|
2182
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2183
|
+
_headers[k] = response.headers[k];
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
if (status === 200) {
|
|
2188
|
+
const _responseText = response.data;
|
|
2189
|
+
let result200 = null;
|
|
2190
|
+
let resultData200 = _responseText;
|
|
2191
|
+
result200 = JSON.parse(resultData200);
|
|
2192
|
+
return Promise.resolve(result200);
|
|
2193
|
+
}
|
|
2194
|
+
else if (status === 404) {
|
|
2195
|
+
const _responseText = response.data;
|
|
2196
|
+
let result404 = null;
|
|
2197
|
+
let resultData404 = _responseText;
|
|
2198
|
+
result404 = JSON.parse(resultData404);
|
|
2199
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2200
|
+
}
|
|
2201
|
+
else if (status === 409) {
|
|
2202
|
+
const _responseText = response.data;
|
|
2203
|
+
let result409 = null;
|
|
2204
|
+
let resultData409 = _responseText;
|
|
2205
|
+
result409 = JSON.parse(resultData409);
|
|
2206
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2207
|
+
}
|
|
2208
|
+
else if (status === 401) {
|
|
2209
|
+
const _responseText = response.data;
|
|
2210
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2211
|
+
}
|
|
2212
|
+
else if (status === 403) {
|
|
2213
|
+
const _responseText = response.data;
|
|
2214
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2215
|
+
}
|
|
2216
|
+
else if (status !== 200 && status !== 204) {
|
|
2217
|
+
const _responseText = response.data;
|
|
2218
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2219
|
+
}
|
|
2220
|
+
return Promise.resolve(null);
|
|
2221
|
+
}
|
|
2222
|
+
/**
|
|
2223
|
+
* Loads variable data printing information from design file taken from storage
|
|
2224
|
+
* @param id Design identifier
|
|
2225
|
+
* @param tenantId (optional) Tenant identifier
|
|
2226
|
+
* @return Success
|
|
2227
|
+
*/
|
|
2228
|
+
loadVdpData(id, tenantId, cancelToken) {
|
|
2229
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdpData?";
|
|
2230
|
+
if (id === undefined || id === null)
|
|
2231
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2232
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2233
|
+
if (tenantId === null)
|
|
2234
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2235
|
+
else if (tenantId !== undefined)
|
|
2236
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2237
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2238
|
+
let options_ = {
|
|
2239
|
+
method: "GET",
|
|
2240
|
+
url: url_,
|
|
2241
|
+
headers: {
|
|
2242
|
+
"Accept": "application/json"
|
|
2243
|
+
},
|
|
2244
|
+
cancelToken
|
|
2245
|
+
};
|
|
2246
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2247
|
+
return this.instance.request(transformedOptions_);
|
|
2248
|
+
}).catch((_error) => {
|
|
2249
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2250
|
+
return _error.response;
|
|
2251
|
+
}
|
|
2252
|
+
else {
|
|
2253
|
+
throw _error;
|
|
2254
|
+
}
|
|
2255
|
+
}).then((_response) => {
|
|
2256
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
processLoadVdpData(response) {
|
|
2260
|
+
const status = response.status;
|
|
2261
|
+
let _headers = {};
|
|
2262
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2263
|
+
for (let k in response.headers) {
|
|
2264
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2265
|
+
_headers[k] = response.headers[k];
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
if (status === 200) {
|
|
2270
|
+
const _responseText = response.data;
|
|
2271
|
+
let result200 = null;
|
|
2272
|
+
let resultData200 = _responseText;
|
|
2273
|
+
result200 = JSON.parse(resultData200);
|
|
2274
|
+
return Promise.resolve(result200);
|
|
2275
|
+
}
|
|
2276
|
+
else if (status === 404) {
|
|
2277
|
+
const _responseText = response.data;
|
|
2278
|
+
let result404 = null;
|
|
2279
|
+
let resultData404 = _responseText;
|
|
2280
|
+
result404 = JSON.parse(resultData404);
|
|
2281
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2282
|
+
}
|
|
2283
|
+
else if (status === 409) {
|
|
2284
|
+
const _responseText = response.data;
|
|
2285
|
+
let result409 = null;
|
|
2286
|
+
let resultData409 = _responseText;
|
|
2287
|
+
result409 = JSON.parse(resultData409);
|
|
2288
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2289
|
+
}
|
|
2290
|
+
else if (status === 401) {
|
|
2291
|
+
const _responseText = response.data;
|
|
2292
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2293
|
+
}
|
|
2294
|
+
else if (status === 403) {
|
|
2295
|
+
const _responseText = response.data;
|
|
2296
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2297
|
+
}
|
|
2298
|
+
else if (status !== 200 && status !== 204) {
|
|
2299
|
+
const _responseText = response.data;
|
|
2300
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2301
|
+
}
|
|
2302
|
+
return Promise.resolve(null);
|
|
2303
|
+
}
|
|
2304
|
+
/**
|
|
2305
|
+
* Saves variable data printing information to design file and updates design in storage.
|
|
2306
|
+
* @param id Design identifier
|
|
2307
|
+
* @param tenantId (optional) Tenant identifier
|
|
2308
|
+
* @param body (optional) Serialized vdp data
|
|
2309
|
+
* @return Success
|
|
2310
|
+
*/
|
|
2311
|
+
saveVdpData(id, tenantId, body, cancelToken) {
|
|
2312
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdpData?";
|
|
2313
|
+
if (id === undefined || id === null)
|
|
2314
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2315
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2316
|
+
if (tenantId === null)
|
|
2317
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2318
|
+
else if (tenantId !== undefined)
|
|
2319
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2320
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2321
|
+
const content_ = JSON.stringify(body);
|
|
2322
|
+
let options_ = {
|
|
2323
|
+
data: content_,
|
|
2324
|
+
method: "PUT",
|
|
2325
|
+
url: url_,
|
|
2326
|
+
headers: {
|
|
2327
|
+
"Content-Type": "application/json",
|
|
2328
|
+
},
|
|
2329
|
+
cancelToken
|
|
2330
|
+
};
|
|
2331
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2332
|
+
return this.instance.request(transformedOptions_);
|
|
2333
|
+
}).catch((_error) => {
|
|
2334
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2335
|
+
return _error.response;
|
|
2336
|
+
}
|
|
2337
|
+
else {
|
|
2338
|
+
throw _error;
|
|
2339
|
+
}
|
|
2340
|
+
}).then((_response) => {
|
|
2341
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
processSaveVdpData(response) {
|
|
2345
|
+
const status = response.status;
|
|
2346
|
+
let _headers = {};
|
|
2347
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2348
|
+
for (let k in response.headers) {
|
|
2349
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2350
|
+
_headers[k] = response.headers[k];
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
if (status === 200) {
|
|
2355
|
+
const _responseText = response.data;
|
|
2356
|
+
return Promise.resolve(null);
|
|
2357
|
+
}
|
|
2358
|
+
else if (status === 404) {
|
|
2359
|
+
const _responseText = response.data;
|
|
2360
|
+
let result404 = null;
|
|
2361
|
+
let resultData404 = _responseText;
|
|
2362
|
+
result404 = JSON.parse(resultData404);
|
|
2363
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2364
|
+
}
|
|
2365
|
+
else if (status === 401) {
|
|
2366
|
+
const _responseText = response.data;
|
|
2367
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2368
|
+
}
|
|
2369
|
+
else if (status === 403) {
|
|
2370
|
+
const _responseText = response.data;
|
|
2371
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2372
|
+
}
|
|
2373
|
+
else if (status !== 200 && status !== 204) {
|
|
2374
|
+
const _responseText = response.data;
|
|
2375
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2376
|
+
}
|
|
2377
|
+
return Promise.resolve(null);
|
|
2378
|
+
}
|
|
2379
|
+
/**
|
|
2380
|
+
* Deletes variable data printing inforamtion from design file and updates design in storage.
|
|
2381
|
+
* @param id Design identifier
|
|
2382
|
+
* @param tenantId (optional) Tenant identifier
|
|
2383
|
+
* @return Success
|
|
2384
|
+
*/
|
|
2385
|
+
deleteVdpData(id, tenantId, cancelToken) {
|
|
2386
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdpData?";
|
|
2387
|
+
if (id === undefined || id === null)
|
|
2388
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2389
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2390
|
+
if (tenantId === null)
|
|
2391
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2392
|
+
else if (tenantId !== undefined)
|
|
2393
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2394
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2395
|
+
let options_ = {
|
|
2396
|
+
method: "DELETE",
|
|
2397
|
+
url: url_,
|
|
2398
|
+
headers: {},
|
|
2399
|
+
cancelToken
|
|
2400
|
+
};
|
|
2401
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2402
|
+
return this.instance.request(transformedOptions_);
|
|
2403
|
+
}).catch((_error) => {
|
|
2404
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2405
|
+
return _error.response;
|
|
2406
|
+
}
|
|
2407
|
+
else {
|
|
2408
|
+
throw _error;
|
|
2409
|
+
}
|
|
2410
|
+
}).then((_response) => {
|
|
2411
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
|
|
2412
|
+
});
|
|
2413
|
+
}
|
|
2414
|
+
processDeleteVdpData(response) {
|
|
2415
|
+
const status = response.status;
|
|
2416
|
+
let _headers = {};
|
|
2417
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2418
|
+
for (let k in response.headers) {
|
|
2419
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2420
|
+
_headers[k] = response.headers[k];
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
if (status === 200) {
|
|
2425
|
+
const _responseText = response.data;
|
|
2426
|
+
return Promise.resolve(null);
|
|
2427
|
+
}
|
|
2428
|
+
else if (status === 409) {
|
|
2429
|
+
const _responseText = response.data;
|
|
2430
|
+
let result409 = null;
|
|
2431
|
+
let resultData409 = _responseText;
|
|
2432
|
+
result409 = JSON.parse(resultData409);
|
|
2433
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2434
|
+
}
|
|
2435
|
+
else if (status === 401) {
|
|
2436
|
+
const _responseText = response.data;
|
|
2437
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2438
|
+
}
|
|
2439
|
+
else if (status === 403) {
|
|
2440
|
+
const _responseText = response.data;
|
|
2441
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2442
|
+
}
|
|
2443
|
+
else if (status !== 200 && status !== 204) {
|
|
2444
|
+
const _responseText = response.data;
|
|
2445
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2446
|
+
}
|
|
2447
|
+
return Promise.resolve(null);
|
|
2448
|
+
}
|
|
2449
|
+
/**
|
|
2450
|
+
* Flatten items
|
|
2451
|
+
* @param tenantId (optional) Tenant identifier
|
|
2452
|
+
* @param body (optional) Items to flatten
|
|
2453
|
+
* @return Success
|
|
2454
|
+
*/
|
|
2455
|
+
flattenItems(tenantId, body, cancelToken) {
|
|
2456
|
+
let url_ = this.baseUrl + "/api/atoms/v1/flatten?";
|
|
2457
|
+
if (tenantId === null)
|
|
2458
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2459
|
+
else if (tenantId !== undefined)
|
|
2460
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2461
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2462
|
+
const content_ = JSON.stringify(body);
|
|
2463
|
+
let options_ = {
|
|
2464
|
+
data: content_,
|
|
2465
|
+
method: "POST",
|
|
2466
|
+
url: url_,
|
|
2467
|
+
headers: {
|
|
2468
|
+
"Content-Type": "application/json",
|
|
2469
|
+
"Accept": "application/json"
|
|
2470
|
+
},
|
|
2471
|
+
cancelToken
|
|
2472
|
+
};
|
|
2473
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2474
|
+
return this.instance.request(transformedOptions_);
|
|
2475
|
+
}).catch((_error) => {
|
|
2476
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2477
|
+
return _error.response;
|
|
2478
|
+
}
|
|
2479
|
+
else {
|
|
2480
|
+
throw _error;
|
|
2481
|
+
}
|
|
2482
|
+
}).then((_response) => {
|
|
2483
|
+
return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
processFlattenItems(response) {
|
|
2487
|
+
const status = response.status;
|
|
2488
|
+
let _headers = {};
|
|
2489
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2490
|
+
for (let k in response.headers) {
|
|
2491
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2492
|
+
_headers[k] = response.headers[k];
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
if (status === 200) {
|
|
2497
|
+
const _responseText = response.data;
|
|
2498
|
+
let result200 = null;
|
|
2499
|
+
let resultData200 = _responseText;
|
|
2500
|
+
result200 = JSON.parse(resultData200);
|
|
2501
|
+
return Promise.resolve(result200);
|
|
2502
|
+
}
|
|
2503
|
+
else if (status === 401) {
|
|
2504
|
+
const _responseText = response.data;
|
|
2505
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2506
|
+
}
|
|
2507
|
+
else if (status === 403) {
|
|
2508
|
+
const _responseText = response.data;
|
|
2509
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2510
|
+
}
|
|
2511
|
+
else if (status !== 200 && status !== 204) {
|
|
2512
|
+
const _responseText = response.data;
|
|
2513
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2514
|
+
}
|
|
2515
|
+
return Promise.resolve(null);
|
|
2516
|
+
}
|
|
2517
|
+
/**
|
|
2518
|
+
* Creates product item
|
|
2519
|
+
* @param itemType (optional) Desired item type
|
|
2520
|
+
* @param tenantId (optional) Tenant identifier
|
|
2521
|
+
* @param sourceType (optional)
|
|
2522
|
+
* @param sourceId (optional)
|
|
2523
|
+
* @param sourceOwnerId (optional)
|
|
2524
|
+
* @param sourceFile (optional)
|
|
2525
|
+
* @return Success
|
|
2526
|
+
*/
|
|
2527
|
+
createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, sourceFile, cancelToken) {
|
|
2528
|
+
let url_ = this.baseUrl + "/api/atoms/v1/itemCreator?";
|
|
2529
|
+
if (itemType !== undefined && itemType !== null)
|
|
2530
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
2531
|
+
if (tenantId === null)
|
|
2532
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2533
|
+
else if (tenantId !== undefined)
|
|
2534
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2535
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2536
|
+
const content_ = new FormData();
|
|
2537
|
+
if (sourceType !== null && sourceType !== undefined)
|
|
2538
|
+
content_.append("sourceType", sourceType.toString());
|
|
2539
|
+
if (sourceId !== null && sourceId !== undefined)
|
|
2540
|
+
content_.append("sourceId", sourceId.toString());
|
|
2541
|
+
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
2542
|
+
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
2543
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
2544
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
2545
|
+
let options_ = {
|
|
2546
|
+
data: content_,
|
|
2547
|
+
method: "POST",
|
|
2548
|
+
url: url_,
|
|
2549
|
+
headers: {
|
|
2550
|
+
"Accept": "application/json"
|
|
2551
|
+
},
|
|
2552
|
+
cancelToken
|
|
2553
|
+
};
|
|
2554
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2555
|
+
return this.instance.request(transformedOptions_);
|
|
2556
|
+
}).catch((_error) => {
|
|
2557
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2558
|
+
return _error.response;
|
|
2559
|
+
}
|
|
2560
|
+
else {
|
|
2561
|
+
throw _error;
|
|
2562
|
+
}
|
|
2563
|
+
}).then((_response) => {
|
|
2564
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItem(_response));
|
|
2565
|
+
});
|
|
2566
|
+
}
|
|
2567
|
+
processCreateItem(response) {
|
|
2568
|
+
const status = response.status;
|
|
2569
|
+
let _headers = {};
|
|
2570
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2571
|
+
for (let k in response.headers) {
|
|
2572
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2573
|
+
_headers[k] = response.headers[k];
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
if (status === 200) {
|
|
2578
|
+
const _responseText = response.data;
|
|
2579
|
+
let result200 = null;
|
|
2580
|
+
let resultData200 = _responseText;
|
|
2581
|
+
result200 = JSON.parse(resultData200);
|
|
2582
|
+
return Promise.resolve(result200);
|
|
2583
|
+
}
|
|
2584
|
+
else if (status === 404) {
|
|
2585
|
+
const _responseText = response.data;
|
|
2586
|
+
let result404 = null;
|
|
2587
|
+
let resultData404 = _responseText;
|
|
2588
|
+
result404 = JSON.parse(resultData404);
|
|
2589
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2590
|
+
}
|
|
2591
|
+
else if (status === 401) {
|
|
2592
|
+
const _responseText = response.data;
|
|
2593
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2594
|
+
}
|
|
2595
|
+
else if (status === 403) {
|
|
2596
|
+
const _responseText = response.data;
|
|
2597
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2598
|
+
}
|
|
2599
|
+
else if (status !== 200 && status !== 204) {
|
|
2600
|
+
const _responseText = response.data;
|
|
2601
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2602
|
+
}
|
|
2603
|
+
return Promise.resolve(null);
|
|
2604
|
+
}
|
|
2605
|
+
/**
|
|
2606
|
+
* Render product proof image with specified parameters.
|
|
2607
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false')
|
|
2608
|
+
* @param tenantId (optional) Tenant identifier
|
|
2609
|
+
* @param body (optional) Preview parameters
|
|
2610
|
+
* @return Success
|
|
2611
|
+
*/
|
|
2612
|
+
renderProduct(attachment, tenantId, body, cancelToken) {
|
|
2613
|
+
let url_ = this.baseUrl + "/api/atoms/v1/renderer?";
|
|
2614
|
+
if (attachment !== undefined && attachment !== null)
|
|
2615
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2616
|
+
if (tenantId === null)
|
|
2617
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2618
|
+
else if (tenantId !== undefined)
|
|
2619
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2620
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2621
|
+
const content_ = JSON.stringify(body);
|
|
2622
|
+
let options_ = {
|
|
2623
|
+
data: content_,
|
|
2624
|
+
responseType: "blob",
|
|
2625
|
+
method: "POST",
|
|
2626
|
+
url: url_,
|
|
2627
|
+
headers: {
|
|
2628
|
+
"Content-Type": "application/json",
|
|
2629
|
+
"Accept": "application/json"
|
|
2630
|
+
},
|
|
2631
|
+
cancelToken
|
|
2632
|
+
};
|
|
2633
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2634
|
+
return this.instance.request(transformedOptions_);
|
|
2635
|
+
}).catch((_error) => {
|
|
2636
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2637
|
+
return _error.response;
|
|
2638
|
+
}
|
|
2639
|
+
else {
|
|
2640
|
+
throw _error;
|
|
2641
|
+
}
|
|
2642
|
+
}).then((_response) => {
|
|
2643
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderProduct(_response));
|
|
2644
|
+
});
|
|
2645
|
+
}
|
|
2646
|
+
processRenderProduct(response) {
|
|
2647
|
+
const status = response.status;
|
|
2648
|
+
let _headers = {};
|
|
2649
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2650
|
+
for (let k in response.headers) {
|
|
2651
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2652
|
+
_headers[k] = response.headers[k];
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
if (status === 200 || status === 206) {
|
|
2657
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2658
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2659
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2660
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2661
|
+
}
|
|
2662
|
+
else if (status === 401) {
|
|
2663
|
+
const _responseText = response.data;
|
|
2664
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2665
|
+
}
|
|
2666
|
+
else if (status === 403) {
|
|
2667
|
+
const _responseText = response.data;
|
|
2668
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2669
|
+
}
|
|
2670
|
+
else if (status !== 200 && status !== 204) {
|
|
2671
|
+
const _responseText = response.data;
|
|
2672
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2673
|
+
}
|
|
2674
|
+
return Promise.resolve(null);
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
exports.DesignAtomsServiceApiClient = DesignAtomsServiceApiClient;
|
|
2678
|
+
class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
2679
|
+
instance;
|
|
2680
|
+
baseUrl;
|
|
2681
|
+
jsonParseReviver = undefined;
|
|
2682
|
+
constructor(configuration, baseUrl, instance) {
|
|
2683
|
+
super(configuration);
|
|
2684
|
+
this.instance = instance ? instance : axios_1.default.create();
|
|
2685
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2686
|
+
}
|
|
2687
|
+
/**
|
|
2688
|
+
* @param tenantId (optional) Tenant identifier
|
|
2689
|
+
* @param body (optional)
|
|
2690
|
+
* @return Success
|
|
2691
|
+
*/
|
|
2692
|
+
cssFonts(tenantId, body, cancelToken) {
|
|
2693
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/cssfonts?";
|
|
2694
|
+
if (tenantId === null)
|
|
2695
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2696
|
+
else if (tenantId !== undefined)
|
|
2697
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2698
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2699
|
+
const content_ = JSON.stringify(body);
|
|
2700
|
+
let options_ = {
|
|
2701
|
+
data: content_,
|
|
2702
|
+
method: "POST",
|
|
2703
|
+
url: url_,
|
|
2704
|
+
headers: {
|
|
2705
|
+
"Content-Type": "application/json",
|
|
2706
|
+
"Accept": "application/json"
|
|
2707
|
+
},
|
|
2708
|
+
cancelToken
|
|
2709
|
+
};
|
|
2710
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2711
|
+
return this.instance.request(transformedOptions_);
|
|
2712
|
+
}).catch((_error) => {
|
|
2713
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2714
|
+
return _error.response;
|
|
2715
|
+
}
|
|
2716
|
+
else {
|
|
2717
|
+
throw _error;
|
|
2718
|
+
}
|
|
2719
|
+
}).then((_response) => {
|
|
2720
|
+
return this.transformResult(url_, _response, (_response) => this.processCssFonts(_response));
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
processCssFonts(response) {
|
|
2724
|
+
const status = response.status;
|
|
2725
|
+
let _headers = {};
|
|
2726
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2727
|
+
for (let k in response.headers) {
|
|
2728
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2729
|
+
_headers[k] = response.headers[k];
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
}
|
|
2733
|
+
if (status === 200) {
|
|
2734
|
+
const _responseText = response.data;
|
|
2735
|
+
let result200 = null;
|
|
2736
|
+
let resultData200 = _responseText;
|
|
2737
|
+
result200 = JSON.parse(resultData200);
|
|
2738
|
+
return Promise.resolve(result200);
|
|
2739
|
+
}
|
|
2740
|
+
else if (status !== 200 && status !== 204) {
|
|
2741
|
+
const _responseText = response.data;
|
|
2742
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2743
|
+
}
|
|
2744
|
+
return Promise.resolve(null);
|
|
2745
|
+
}
|
|
2746
|
+
/**
|
|
2747
|
+
* @param tenantId (optional) Tenant identifier
|
|
2748
|
+
* @return Success
|
|
2749
|
+
*/
|
|
2750
|
+
fonts(psName, tenantId, cancelToken) {
|
|
2751
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/fonts/{psName}?";
|
|
2752
|
+
if (psName === undefined || psName === null)
|
|
2753
|
+
throw new Error("The parameter 'psName' must be defined.");
|
|
2754
|
+
url_ = url_.replace("{psName}", encodeURIComponent("" + psName));
|
|
2755
|
+
if (tenantId === null)
|
|
2756
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2757
|
+
else if (tenantId !== undefined)
|
|
2758
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2759
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2760
|
+
let options_ = {
|
|
2761
|
+
responseType: "blob",
|
|
2762
|
+
method: "GET",
|
|
2763
|
+
url: url_,
|
|
2764
|
+
headers: {
|
|
2765
|
+
"Accept": "application/octet-stream"
|
|
2766
|
+
},
|
|
2767
|
+
cancelToken
|
|
2768
|
+
};
|
|
2769
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2770
|
+
return this.instance.request(transformedOptions_);
|
|
2771
|
+
}).catch((_error) => {
|
|
2772
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2773
|
+
return _error.response;
|
|
2774
|
+
}
|
|
2775
|
+
else {
|
|
2776
|
+
throw _error;
|
|
2777
|
+
}
|
|
2778
|
+
}).then((_response) => {
|
|
2779
|
+
return this.transformResult(url_, _response, (_response) => this.processFonts(_response));
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
processFonts(response) {
|
|
2783
|
+
const status = response.status;
|
|
2784
|
+
let _headers = {};
|
|
2785
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2786
|
+
for (let k in response.headers) {
|
|
2787
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2788
|
+
_headers[k] = response.headers[k];
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
if (status === 200 || status === 206) {
|
|
2793
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2794
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2795
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2796
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2797
|
+
}
|
|
2798
|
+
else if (status === 404) {
|
|
2799
|
+
const _responseText = response.data;
|
|
2800
|
+
let result404 = null;
|
|
2801
|
+
let resultData404 = _responseText;
|
|
2802
|
+
result404 = JSON.parse(resultData404);
|
|
2803
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2804
|
+
}
|
|
2805
|
+
else if (status !== 200 && status !== 204) {
|
|
2806
|
+
const _responseText = response.data;
|
|
2807
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2808
|
+
}
|
|
2809
|
+
return Promise.resolve(null);
|
|
2810
|
+
}
|
|
2811
|
+
/**
|
|
2812
|
+
* @param fontKey (optional)
|
|
2813
|
+
* @param tenantId (optional) Tenant identifier
|
|
2814
|
+
* @return Success
|
|
2815
|
+
*/
|
|
2816
|
+
getCssFont(fontKey, tenantId, cancelToken) {
|
|
2817
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/GetCssFont?";
|
|
2818
|
+
if (fontKey !== undefined && fontKey !== null)
|
|
2819
|
+
url_ += "fontKey=" + encodeURIComponent("" + fontKey) + "&";
|
|
2820
|
+
if (tenantId === null)
|
|
2821
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2822
|
+
else if (tenantId !== undefined)
|
|
2823
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2824
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2825
|
+
let options_ = {
|
|
2826
|
+
responseType: "blob",
|
|
2827
|
+
method: "GET",
|
|
2828
|
+
url: url_,
|
|
2829
|
+
headers: {
|
|
2830
|
+
"Accept": "application/json"
|
|
2831
|
+
},
|
|
2832
|
+
cancelToken
|
|
2833
|
+
};
|
|
2834
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2835
|
+
return this.instance.request(transformedOptions_);
|
|
2836
|
+
}).catch((_error) => {
|
|
2837
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2838
|
+
return _error.response;
|
|
2839
|
+
}
|
|
2840
|
+
else {
|
|
2841
|
+
throw _error;
|
|
2842
|
+
}
|
|
2843
|
+
}).then((_response) => {
|
|
2844
|
+
return this.transformResult(url_, _response, (_response) => this.processGetCssFont(_response));
|
|
2845
|
+
});
|
|
2846
|
+
}
|
|
2847
|
+
processGetCssFont(response) {
|
|
2848
|
+
const status = response.status;
|
|
2849
|
+
let _headers = {};
|
|
2850
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2851
|
+
for (let k in response.headers) {
|
|
2852
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2853
|
+
_headers[k] = response.headers[k];
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
if (status === 200 || status === 206) {
|
|
2858
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2859
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2860
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2861
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2862
|
+
}
|
|
2863
|
+
else if (status === 404) {
|
|
2864
|
+
const _responseText = response.data;
|
|
2865
|
+
let result404 = null;
|
|
2866
|
+
let resultData404 = _responseText;
|
|
2867
|
+
result404 = JSON.parse(resultData404);
|
|
2868
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2869
|
+
}
|
|
2870
|
+
else if (status !== 200 && status !== 204) {
|
|
2871
|
+
const _responseText = response.data;
|
|
2872
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2873
|
+
}
|
|
2874
|
+
return Promise.resolve(null);
|
|
2875
|
+
}
|
|
2876
|
+
/**
|
|
2877
|
+
* @param tenantId (optional) Tenant identifier
|
|
2878
|
+
* @param body (optional)
|
|
2879
|
+
* @return Success
|
|
2880
|
+
*/
|
|
2881
|
+
getImageSize(tenantId, body, cancelToken) {
|
|
2882
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/GetImageSize?";
|
|
2883
|
+
if (tenantId === null)
|
|
2884
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2885
|
+
else if (tenantId !== undefined)
|
|
2886
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2887
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2888
|
+
const content_ = JSON.stringify(body);
|
|
2889
|
+
let options_ = {
|
|
2890
|
+
data: content_,
|
|
2891
|
+
method: "POST",
|
|
2892
|
+
url: url_,
|
|
2893
|
+
headers: {
|
|
2894
|
+
"Content-Type": "application/json",
|
|
2895
|
+
"Accept": "application/json"
|
|
2896
|
+
},
|
|
2897
|
+
cancelToken
|
|
2898
|
+
};
|
|
2899
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2900
|
+
return this.instance.request(transformedOptions_);
|
|
2901
|
+
}).catch((_error) => {
|
|
2902
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2903
|
+
return _error.response;
|
|
2904
|
+
}
|
|
2905
|
+
else {
|
|
2906
|
+
throw _error;
|
|
2907
|
+
}
|
|
2908
|
+
}).then((_response) => {
|
|
2909
|
+
return this.transformResult(url_, _response, (_response) => this.processGetImageSize(_response));
|
|
2910
|
+
});
|
|
2911
|
+
}
|
|
2912
|
+
processGetImageSize(response) {
|
|
2913
|
+
const status = response.status;
|
|
2914
|
+
let _headers = {};
|
|
2915
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2916
|
+
for (let k in response.headers) {
|
|
2917
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2918
|
+
_headers[k] = response.headers[k];
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
if (status === 200) {
|
|
2923
|
+
const _responseText = response.data;
|
|
2924
|
+
let result200 = null;
|
|
2925
|
+
let resultData200 = _responseText;
|
|
2926
|
+
result200 = JSON.parse(resultData200);
|
|
2927
|
+
return Promise.resolve(result200);
|
|
2928
|
+
}
|
|
2929
|
+
else if (status !== 200 && status !== 204) {
|
|
2930
|
+
const _responseText = response.data;
|
|
2931
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2932
|
+
}
|
|
2933
|
+
return Promise.resolve(null);
|
|
2934
|
+
}
|
|
2935
|
+
/**
|
|
2936
|
+
* @param tenantId (optional) Tenant identifier
|
|
2937
|
+
* @param body (optional)
|
|
2938
|
+
* @return Success
|
|
2939
|
+
*/
|
|
2940
|
+
getShapeBounds(tenantId, body, cancelToken) {
|
|
2941
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/GetShapeBounds?";
|
|
2942
|
+
if (tenantId === null)
|
|
2943
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2944
|
+
else if (tenantId !== undefined)
|
|
2945
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2946
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2947
|
+
const content_ = JSON.stringify(body);
|
|
2948
|
+
let options_ = {
|
|
2949
|
+
data: content_,
|
|
2950
|
+
method: "POST",
|
|
2951
|
+
url: url_,
|
|
2952
|
+
headers: {
|
|
2953
|
+
"Content-Type": "application/json",
|
|
2954
|
+
"Accept": "application/json"
|
|
2955
|
+
},
|
|
2956
|
+
cancelToken
|
|
2957
|
+
};
|
|
2958
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2959
|
+
return this.instance.request(transformedOptions_);
|
|
2960
|
+
}).catch((_error) => {
|
|
2961
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2962
|
+
return _error.response;
|
|
2963
|
+
}
|
|
2964
|
+
else {
|
|
2965
|
+
throw _error;
|
|
2966
|
+
}
|
|
2967
|
+
}).then((_response) => {
|
|
2968
|
+
return this.transformResult(url_, _response, (_response) => this.processGetShapeBounds(_response));
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
processGetShapeBounds(response) {
|
|
2972
|
+
const status = response.status;
|
|
2973
|
+
let _headers = {};
|
|
2974
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2975
|
+
for (let k in response.headers) {
|
|
2976
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2977
|
+
_headers[k] = response.headers[k];
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
if (status === 200) {
|
|
2982
|
+
const _responseText = response.data;
|
|
2983
|
+
let result200 = null;
|
|
2984
|
+
let resultData200 = _responseText;
|
|
2985
|
+
result200 = JSON.parse(resultData200);
|
|
2986
|
+
return Promise.resolve(result200);
|
|
2987
|
+
}
|
|
2988
|
+
else if (status !== 200 && status !== 204) {
|
|
2989
|
+
const _responseText = response.data;
|
|
2990
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2991
|
+
}
|
|
2992
|
+
return Promise.resolve(null);
|
|
2993
|
+
}
|
|
2994
|
+
/**
|
|
2995
|
+
* @param tenantId (optional) Tenant identifier
|
|
2996
|
+
* @param body (optional)
|
|
2997
|
+
* @return Success
|
|
2998
|
+
*/
|
|
2999
|
+
getWatermarkItems(tenantId, body, cancelToken) {
|
|
3000
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/GetWatermarkItems?";
|
|
3001
|
+
if (tenantId === null)
|
|
3002
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3003
|
+
else if (tenantId !== undefined)
|
|
3004
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3005
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3006
|
+
const content_ = JSON.stringify(body);
|
|
3007
|
+
let options_ = {
|
|
3008
|
+
data: content_,
|
|
3009
|
+
method: "POST",
|
|
3010
|
+
url: url_,
|
|
3011
|
+
headers: {
|
|
3012
|
+
"Content-Type": "application/json",
|
|
3013
|
+
"Accept": "application/json"
|
|
3014
|
+
},
|
|
3015
|
+
cancelToken
|
|
3016
|
+
};
|
|
3017
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3018
|
+
return this.instance.request(transformedOptions_);
|
|
3019
|
+
}).catch((_error) => {
|
|
3020
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3021
|
+
return _error.response;
|
|
3022
|
+
}
|
|
3023
|
+
else {
|
|
3024
|
+
throw _error;
|
|
3025
|
+
}
|
|
3026
|
+
}).then((_response) => {
|
|
3027
|
+
return this.transformResult(url_, _response, (_response) => this.processGetWatermarkItems(_response));
|
|
3028
|
+
});
|
|
3029
|
+
}
|
|
3030
|
+
processGetWatermarkItems(response) {
|
|
3031
|
+
const status = response.status;
|
|
3032
|
+
let _headers = {};
|
|
3033
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3034
|
+
for (let k in response.headers) {
|
|
3035
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3036
|
+
_headers[k] = response.headers[k];
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
if (status === 200) {
|
|
3041
|
+
const _responseText = response.data;
|
|
3042
|
+
let result200 = null;
|
|
3043
|
+
let resultData200 = _responseText;
|
|
3044
|
+
result200 = JSON.parse(resultData200);
|
|
3045
|
+
return Promise.resolve(result200);
|
|
3046
|
+
}
|
|
3047
|
+
else if (status !== 200 && status !== 204) {
|
|
3048
|
+
const _responseText = response.data;
|
|
3049
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3050
|
+
}
|
|
3051
|
+
return Promise.resolve(null);
|
|
3052
|
+
}
|
|
3053
|
+
/**
|
|
3054
|
+
* @param f (optional)
|
|
3055
|
+
* @param w (optional)
|
|
3056
|
+
* @param h (optional)
|
|
3057
|
+
* @param cmyk (optional)
|
|
3058
|
+
* @param rgb (optional)
|
|
3059
|
+
* @param grayscale (optional)
|
|
3060
|
+
* @param target (optional)
|
|
3061
|
+
* @param sq (optional)
|
|
3062
|
+
* @param effect (optional)
|
|
3063
|
+
* @param kp (optional)
|
|
3064
|
+
* @param color (optional)
|
|
3065
|
+
* @param obm (optional)
|
|
3066
|
+
* @param oo (optional)
|
|
3067
|
+
* @param alphaMask (optional)
|
|
3068
|
+
* @param page (optional)
|
|
3069
|
+
* @param colorizeColor (optional)
|
|
3070
|
+
* @param tenantId (optional) Tenant identifier
|
|
3071
|
+
* @return Success
|
|
3072
|
+
*/
|
|
3073
|
+
img(f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, tenantId, cancelToken) {
|
|
3074
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/img?";
|
|
3075
|
+
if (f !== undefined && f !== null)
|
|
3076
|
+
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
3077
|
+
if (w !== undefined && w !== null)
|
|
3078
|
+
url_ += "w=" + encodeURIComponent("" + w) + "&";
|
|
3079
|
+
if (h !== undefined && h !== null)
|
|
3080
|
+
url_ += "h=" + encodeURIComponent("" + h) + "&";
|
|
3081
|
+
if (cmyk !== undefined && cmyk !== null)
|
|
3082
|
+
url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
|
|
3083
|
+
if (rgb !== undefined && rgb !== null)
|
|
3084
|
+
url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
|
|
3085
|
+
if (grayscale !== undefined && grayscale !== null)
|
|
3086
|
+
url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
|
|
3087
|
+
if (target !== undefined && target !== null)
|
|
3088
|
+
url_ += "target=" + encodeURIComponent("" + target) + "&";
|
|
3089
|
+
if (sq !== undefined && sq !== null)
|
|
3090
|
+
url_ += "sq=" + encodeURIComponent("" + sq) + "&";
|
|
3091
|
+
if (effect !== undefined && effect !== null)
|
|
3092
|
+
url_ += "effect=" + encodeURIComponent("" + effect) + "&";
|
|
3093
|
+
if (kp !== undefined && kp !== null)
|
|
3094
|
+
url_ += "kp=" + encodeURIComponent("" + kp) + "&";
|
|
3095
|
+
if (color !== undefined && color !== null)
|
|
3096
|
+
url_ += "color=" + encodeURIComponent("" + color) + "&";
|
|
3097
|
+
if (obm !== undefined && obm !== null)
|
|
3098
|
+
url_ += "obm=" + encodeURIComponent("" + obm) + "&";
|
|
3099
|
+
if (oo !== undefined && oo !== null)
|
|
3100
|
+
url_ += "oo=" + encodeURIComponent("" + oo) + "&";
|
|
3101
|
+
if (alphaMask !== undefined && alphaMask !== null)
|
|
3102
|
+
url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
|
|
3103
|
+
if (page !== undefined && page !== null)
|
|
3104
|
+
url_ += "page=" + encodeURIComponent("" + page) + "&";
|
|
3105
|
+
if (colorizeColor !== undefined && colorizeColor !== null)
|
|
3106
|
+
url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
|
|
3107
|
+
if (tenantId === null)
|
|
3108
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3109
|
+
else if (tenantId !== undefined)
|
|
3110
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3111
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3112
|
+
let options_ = {
|
|
3113
|
+
responseType: "blob",
|
|
3114
|
+
method: "GET",
|
|
3115
|
+
url: url_,
|
|
3116
|
+
headers: {
|
|
3117
|
+
"Accept": "application/json"
|
|
3118
|
+
},
|
|
3119
|
+
cancelToken
|
|
3120
|
+
};
|
|
3121
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3122
|
+
return this.instance.request(transformedOptions_);
|
|
3123
|
+
}).catch((_error) => {
|
|
3124
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3125
|
+
return _error.response;
|
|
3126
|
+
}
|
|
3127
|
+
else {
|
|
3128
|
+
throw _error;
|
|
3129
|
+
}
|
|
3130
|
+
}).then((_response) => {
|
|
3131
|
+
return this.transformResult(url_, _response, (_response) => this.processImg(_response));
|
|
3132
|
+
});
|
|
3133
|
+
}
|
|
3134
|
+
processImg(response) {
|
|
3135
|
+
const status = response.status;
|
|
3136
|
+
let _headers = {};
|
|
3137
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3138
|
+
for (let k in response.headers) {
|
|
3139
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3140
|
+
_headers[k] = response.headers[k];
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
if (status === 200 || status === 206) {
|
|
3145
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3146
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3147
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3148
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3149
|
+
}
|
|
3150
|
+
else if (status === 304) {
|
|
3151
|
+
const _responseText = response.data;
|
|
3152
|
+
return throwException("Not Modified", status, _responseText, _headers);
|
|
3153
|
+
}
|
|
3154
|
+
else if (status === 404) {
|
|
3155
|
+
const _responseText = response.data;
|
|
3156
|
+
let result404 = null;
|
|
3157
|
+
let resultData404 = _responseText;
|
|
3158
|
+
result404 = JSON.parse(resultData404);
|
|
3159
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3160
|
+
}
|
|
3161
|
+
else if (status !== 200 && status !== 204) {
|
|
3162
|
+
const _responseText = response.data;
|
|
3163
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3164
|
+
}
|
|
3165
|
+
return Promise.resolve(null);
|
|
3166
|
+
}
|
|
3167
|
+
/**
|
|
3168
|
+
* @param tenantId (optional) Tenant identifier
|
|
3169
|
+
* @return Success
|
|
3170
|
+
*/
|
|
3171
|
+
getLicense(tenantId, cancelToken) {
|
|
3172
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/license?";
|
|
3173
|
+
if (tenantId === null)
|
|
3174
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3175
|
+
else if (tenantId !== undefined)
|
|
3176
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3177
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3178
|
+
let options_ = {
|
|
3179
|
+
method: "GET",
|
|
3180
|
+
url: url_,
|
|
3181
|
+
headers: {
|
|
3182
|
+
"Accept": "application/json"
|
|
3183
|
+
},
|
|
3184
|
+
cancelToken
|
|
3185
|
+
};
|
|
3186
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3187
|
+
return this.instance.request(transformedOptions_);
|
|
3188
|
+
}).catch((_error) => {
|
|
3189
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3190
|
+
return _error.response;
|
|
3191
|
+
}
|
|
3192
|
+
else {
|
|
3193
|
+
throw _error;
|
|
3194
|
+
}
|
|
3195
|
+
}).then((_response) => {
|
|
3196
|
+
return this.transformResult(url_, _response, (_response) => this.processGetLicense(_response));
|
|
3197
|
+
});
|
|
3198
|
+
}
|
|
3199
|
+
processGetLicense(response) {
|
|
3200
|
+
const status = response.status;
|
|
3201
|
+
let _headers = {};
|
|
3202
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3203
|
+
for (let k in response.headers) {
|
|
3204
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3205
|
+
_headers[k] = response.headers[k];
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
if (status === 200) {
|
|
3210
|
+
const _responseText = response.data;
|
|
3211
|
+
let result200 = null;
|
|
3212
|
+
let resultData200 = _responseText;
|
|
3213
|
+
result200 = JSON.parse(resultData200);
|
|
3214
|
+
return Promise.resolve(result200);
|
|
3215
|
+
}
|
|
3216
|
+
else if (status !== 200 && status !== 204) {
|
|
3217
|
+
const _responseText = response.data;
|
|
3218
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3219
|
+
}
|
|
3220
|
+
return Promise.resolve(null);
|
|
3221
|
+
}
|
|
3222
|
+
/**
|
|
3223
|
+
* @param f (optional)
|
|
3224
|
+
* @param tenantId (optional) Tenant identifier
|
|
3225
|
+
* @return Success
|
|
3226
|
+
*/
|
|
3227
|
+
pth(f, tenantId, cancelToken) {
|
|
3228
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/pth?";
|
|
3229
|
+
if (f !== undefined && f !== null)
|
|
3230
|
+
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
3231
|
+
if (tenantId === null)
|
|
3232
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3233
|
+
else if (tenantId !== undefined)
|
|
3234
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3235
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3236
|
+
let options_ = {
|
|
3237
|
+
responseType: "blob",
|
|
3238
|
+
method: "GET",
|
|
3239
|
+
url: url_,
|
|
3240
|
+
headers: {
|
|
3241
|
+
"Accept": "application/json"
|
|
3242
|
+
},
|
|
3243
|
+
cancelToken
|
|
3244
|
+
};
|
|
3245
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3246
|
+
return this.instance.request(transformedOptions_);
|
|
3247
|
+
}).catch((_error) => {
|
|
3248
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3249
|
+
return _error.response;
|
|
3250
|
+
}
|
|
3251
|
+
else {
|
|
3252
|
+
throw _error;
|
|
3253
|
+
}
|
|
3254
|
+
}).then((_response) => {
|
|
3255
|
+
return this.transformResult(url_, _response, (_response) => this.processPth(_response));
|
|
3256
|
+
});
|
|
3257
|
+
}
|
|
3258
|
+
processPth(response) {
|
|
3259
|
+
const status = response.status;
|
|
3260
|
+
let _headers = {};
|
|
3261
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3262
|
+
for (let k in response.headers) {
|
|
3263
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3264
|
+
_headers[k] = response.headers[k];
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
if (status === 200 || status === 206) {
|
|
3269
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3270
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3271
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3272
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3273
|
+
}
|
|
3274
|
+
else if (status === 304) {
|
|
3275
|
+
const _responseText = response.data;
|
|
3276
|
+
return throwException("Not Modified", status, _responseText, _headers);
|
|
3277
|
+
}
|
|
3278
|
+
else if (status === 404) {
|
|
3279
|
+
const _responseText = response.data;
|
|
3280
|
+
let result404 = null;
|
|
3281
|
+
let resultData404 = _responseText;
|
|
3282
|
+
result404 = JSON.parse(resultData404);
|
|
3283
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3284
|
+
}
|
|
3285
|
+
else if (status !== 200 && status !== 204) {
|
|
3286
|
+
const _responseText = response.data;
|
|
3287
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3288
|
+
}
|
|
3289
|
+
return Promise.resolve(null);
|
|
3290
|
+
}
|
|
3291
|
+
/**
|
|
3292
|
+
* @param image (optional)
|
|
3293
|
+
* @param tenantId (optional) Tenant identifier
|
|
3294
|
+
* @return Success
|
|
3295
|
+
*/
|
|
3296
|
+
resource(image, tenantId, cancelToken) {
|
|
3297
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/resource?";
|
|
3298
|
+
if (image !== undefined && image !== null)
|
|
3299
|
+
url_ += "image=" + encodeURIComponent("" + image) + "&";
|
|
3300
|
+
if (tenantId === null)
|
|
3301
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3302
|
+
else if (tenantId !== undefined)
|
|
3303
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3304
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3305
|
+
let options_ = {
|
|
3306
|
+
responseType: "blob",
|
|
3307
|
+
method: "GET",
|
|
3308
|
+
url: url_,
|
|
3309
|
+
headers: {
|
|
3310
|
+
"Accept": "application/json"
|
|
3311
|
+
},
|
|
3312
|
+
cancelToken
|
|
3313
|
+
};
|
|
3314
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3315
|
+
return this.instance.request(transformedOptions_);
|
|
3316
|
+
}).catch((_error) => {
|
|
3317
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3318
|
+
return _error.response;
|
|
3319
|
+
}
|
|
3320
|
+
else {
|
|
3321
|
+
throw _error;
|
|
3322
|
+
}
|
|
3323
|
+
}).then((_response) => {
|
|
3324
|
+
return this.transformResult(url_, _response, (_response) => this.processResource(_response));
|
|
3325
|
+
});
|
|
3326
|
+
}
|
|
3327
|
+
processResource(response) {
|
|
3328
|
+
const status = response.status;
|
|
3329
|
+
let _headers = {};
|
|
3330
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3331
|
+
for (let k in response.headers) {
|
|
3332
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3333
|
+
_headers[k] = response.headers[k];
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
if (status === 200 || status === 206) {
|
|
3338
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3339
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3340
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3341
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3342
|
+
}
|
|
3343
|
+
else if (status === 404) {
|
|
3344
|
+
const _responseText = response.data;
|
|
3345
|
+
let result404 = null;
|
|
3346
|
+
let resultData404 = _responseText;
|
|
3347
|
+
result404 = JSON.parse(resultData404);
|
|
3348
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3349
|
+
}
|
|
3350
|
+
else if (status !== 200 && status !== 204) {
|
|
3351
|
+
const _responseText = response.data;
|
|
3352
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3353
|
+
}
|
|
3354
|
+
return Promise.resolve(null);
|
|
3355
|
+
}
|
|
3356
|
+
/**
|
|
3357
|
+
* @param f (optional)
|
|
3358
|
+
* @param tenantId (optional) Tenant identifier
|
|
3359
|
+
* @return Success
|
|
3360
|
+
*/
|
|
3361
|
+
svg(f, tenantId, cancelToken) {
|
|
3362
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/svg?";
|
|
3363
|
+
if (f !== undefined && f !== null)
|
|
3364
|
+
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
3365
|
+
if (tenantId === null)
|
|
3366
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3367
|
+
else if (tenantId !== undefined)
|
|
3368
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3369
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3370
|
+
let options_ = {
|
|
3371
|
+
responseType: "blob",
|
|
3372
|
+
method: "GET",
|
|
3373
|
+
url: url_,
|
|
3374
|
+
headers: {
|
|
3375
|
+
"Accept": "application/json"
|
|
3376
|
+
},
|
|
3377
|
+
cancelToken
|
|
3378
|
+
};
|
|
3379
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3380
|
+
return this.instance.request(transformedOptions_);
|
|
3381
|
+
}).catch((_error) => {
|
|
3382
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3383
|
+
return _error.response;
|
|
3384
|
+
}
|
|
3385
|
+
else {
|
|
3386
|
+
throw _error;
|
|
3387
|
+
}
|
|
3388
|
+
}).then((_response) => {
|
|
3389
|
+
return this.transformResult(url_, _response, (_response) => this.processSvg(_response));
|
|
3390
|
+
});
|
|
3391
|
+
}
|
|
3392
|
+
processSvg(response) {
|
|
3393
|
+
const status = response.status;
|
|
3394
|
+
let _headers = {};
|
|
3395
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3396
|
+
for (let k in response.headers) {
|
|
3397
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3398
|
+
_headers[k] = response.headers[k];
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
}
|
|
3402
|
+
if (status === 200 || status === 206) {
|
|
3403
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3404
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3405
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3406
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3407
|
+
}
|
|
3408
|
+
else if (status === 304) {
|
|
3409
|
+
const _responseText = response.data;
|
|
3410
|
+
return throwException("Not Modified", status, _responseText, _headers);
|
|
3411
|
+
}
|
|
3412
|
+
else if (status === 404) {
|
|
3413
|
+
const _responseText = response.data;
|
|
3414
|
+
let result404 = null;
|
|
3415
|
+
let resultData404 = _responseText;
|
|
3416
|
+
result404 = JSON.parse(resultData404);
|
|
3417
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3418
|
+
}
|
|
3419
|
+
else if (status !== 200 && status !== 204) {
|
|
3420
|
+
const _responseText = response.data;
|
|
3421
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3422
|
+
}
|
|
3423
|
+
return Promise.resolve(null);
|
|
3424
|
+
}
|
|
3425
|
+
/**
|
|
3426
|
+
* @param f (optional)
|
|
3427
|
+
* @param tenantId (optional) Tenant identifier
|
|
3428
|
+
* @return Success
|
|
3429
|
+
*/
|
|
3430
|
+
txt(f, tenantId, cancelToken) {
|
|
3431
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/txt?";
|
|
3432
|
+
if (f !== undefined && f !== null)
|
|
3433
|
+
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
3434
|
+
if (tenantId === null)
|
|
3435
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3436
|
+
else if (tenantId !== undefined)
|
|
3437
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3438
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3439
|
+
let options_ = {
|
|
3440
|
+
responseType: "blob",
|
|
3441
|
+
method: "GET",
|
|
3442
|
+
url: url_,
|
|
3443
|
+
headers: {
|
|
3444
|
+
"Accept": "application/json"
|
|
3445
|
+
},
|
|
3446
|
+
cancelToken
|
|
3447
|
+
};
|
|
3448
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3449
|
+
return this.instance.request(transformedOptions_);
|
|
3450
|
+
}).catch((_error) => {
|
|
3451
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3452
|
+
return _error.response;
|
|
3453
|
+
}
|
|
3454
|
+
else {
|
|
3455
|
+
throw _error;
|
|
3456
|
+
}
|
|
3457
|
+
}).then((_response) => {
|
|
3458
|
+
return this.transformResult(url_, _response, (_response) => this.processTxt(_response));
|
|
3459
|
+
});
|
|
3460
|
+
}
|
|
3461
|
+
processTxt(response) {
|
|
3462
|
+
const status = response.status;
|
|
3463
|
+
let _headers = {};
|
|
3464
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3465
|
+
for (let k in response.headers) {
|
|
3466
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3467
|
+
_headers[k] = response.headers[k];
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
if (status === 200 || status === 206) {
|
|
3472
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3473
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3474
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3475
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3476
|
+
}
|
|
3477
|
+
else if (status === 304) {
|
|
3478
|
+
const _responseText = response.data;
|
|
3479
|
+
return throwException("Not Modified", status, _responseText, _headers);
|
|
3480
|
+
}
|
|
3481
|
+
else if (status === 404) {
|
|
3482
|
+
const _responseText = response.data;
|
|
3483
|
+
let result404 = null;
|
|
3484
|
+
let resultData404 = _responseText;
|
|
3485
|
+
result404 = JSON.parse(resultData404);
|
|
3486
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3487
|
+
}
|
|
3488
|
+
else if (status !== 200 && status !== 204) {
|
|
3489
|
+
const _responseText = response.data;
|
|
3490
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3491
|
+
}
|
|
3492
|
+
return Promise.resolve(null);
|
|
3493
|
+
}
|
|
3494
|
+
/**
|
|
3495
|
+
* @param tenantId (optional) Tenant identifier
|
|
3496
|
+
* @param body (optional)
|
|
3497
|
+
* @return Success
|
|
3498
|
+
*/
|
|
3499
|
+
updateArchedTextItemHandler(tenantId, body, cancelToken) {
|
|
3500
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdateArchedTextItemHandler?";
|
|
3501
|
+
if (tenantId === null)
|
|
3502
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3503
|
+
else if (tenantId !== undefined)
|
|
3504
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3505
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3506
|
+
const content_ = JSON.stringify(body);
|
|
3507
|
+
let options_ = {
|
|
3508
|
+
data: content_,
|
|
3509
|
+
method: "POST",
|
|
3510
|
+
url: url_,
|
|
3511
|
+
headers: {
|
|
3512
|
+
"Content-Type": "application/json",
|
|
3513
|
+
"Accept": "application/json"
|
|
3514
|
+
},
|
|
3515
|
+
cancelToken
|
|
3516
|
+
};
|
|
3517
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3518
|
+
return this.instance.request(transformedOptions_);
|
|
3519
|
+
}).catch((_error) => {
|
|
3520
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3521
|
+
return _error.response;
|
|
3522
|
+
}
|
|
3523
|
+
else {
|
|
3524
|
+
throw _error;
|
|
3525
|
+
}
|
|
3526
|
+
}).then((_response) => {
|
|
3527
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateArchedTextItemHandler(_response));
|
|
3528
|
+
});
|
|
3529
|
+
}
|
|
3530
|
+
processUpdateArchedTextItemHandler(response) {
|
|
3531
|
+
const status = response.status;
|
|
3532
|
+
let _headers = {};
|
|
3533
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3534
|
+
for (let k in response.headers) {
|
|
3535
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3536
|
+
_headers[k] = response.headers[k];
|
|
3537
|
+
}
|
|
3538
|
+
}
|
|
3539
|
+
}
|
|
3540
|
+
if (status === 200) {
|
|
3541
|
+
const _responseText = response.data;
|
|
3542
|
+
let result200 = null;
|
|
3543
|
+
let resultData200 = _responseText;
|
|
3544
|
+
result200 = JSON.parse(resultData200);
|
|
3545
|
+
return Promise.resolve(result200);
|
|
3546
|
+
}
|
|
3547
|
+
else if (status !== 200 && status !== 204) {
|
|
3548
|
+
const _responseText = response.data;
|
|
3549
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3550
|
+
}
|
|
3551
|
+
return Promise.resolve(null);
|
|
3552
|
+
}
|
|
3553
|
+
/**
|
|
3554
|
+
* @param tenantId (optional) Tenant identifier
|
|
3555
|
+
* @param body (optional)
|
|
3556
|
+
* @return Success
|
|
3557
|
+
*/
|
|
3558
|
+
updateAutoScaledTextItemHandler(tenantId, body, cancelToken) {
|
|
3559
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdateAutoScaledTextItemHandler?";
|
|
3560
|
+
if (tenantId === null)
|
|
3561
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3562
|
+
else if (tenantId !== undefined)
|
|
3563
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3564
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3565
|
+
const content_ = JSON.stringify(body);
|
|
3566
|
+
let options_ = {
|
|
3567
|
+
data: content_,
|
|
3568
|
+
method: "POST",
|
|
3569
|
+
url: url_,
|
|
3570
|
+
headers: {
|
|
3571
|
+
"Content-Type": "application/json",
|
|
3572
|
+
"Accept": "application/json"
|
|
3573
|
+
},
|
|
3574
|
+
cancelToken
|
|
3575
|
+
};
|
|
3576
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3577
|
+
return this.instance.request(transformedOptions_);
|
|
3578
|
+
}).catch((_error) => {
|
|
3579
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3580
|
+
return _error.response;
|
|
3581
|
+
}
|
|
3582
|
+
else {
|
|
3583
|
+
throw _error;
|
|
3584
|
+
}
|
|
3585
|
+
}).then((_response) => {
|
|
3586
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateAutoScaledTextItemHandler(_response));
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3589
|
+
processUpdateAutoScaledTextItemHandler(response) {
|
|
3590
|
+
const status = response.status;
|
|
3591
|
+
let _headers = {};
|
|
3592
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3593
|
+
for (let k in response.headers) {
|
|
3594
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3595
|
+
_headers[k] = response.headers[k];
|
|
3596
|
+
}
|
|
3597
|
+
}
|
|
3598
|
+
}
|
|
3599
|
+
if (status === 200) {
|
|
3600
|
+
const _responseText = response.data;
|
|
3601
|
+
let result200 = null;
|
|
3602
|
+
let resultData200 = _responseText;
|
|
3603
|
+
result200 = JSON.parse(resultData200);
|
|
3604
|
+
return Promise.resolve(result200);
|
|
3605
|
+
}
|
|
3606
|
+
else if (status !== 200 && status !== 204) {
|
|
3607
|
+
const _responseText = response.data;
|
|
3608
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3609
|
+
}
|
|
3610
|
+
return Promise.resolve(null);
|
|
3611
|
+
}
|
|
3612
|
+
/**
|
|
3613
|
+
* @param tenantId (optional) Tenant identifier
|
|
3614
|
+
* @param body (optional)
|
|
3615
|
+
* @return Success
|
|
3616
|
+
*/
|
|
3617
|
+
updateBarcodeItemHandler(tenantId, body, cancelToken) {
|
|
3618
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdateBarcodeItemHandler?";
|
|
3619
|
+
if (tenantId === null)
|
|
3620
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3621
|
+
else if (tenantId !== undefined)
|
|
3622
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3623
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3624
|
+
const content_ = JSON.stringify(body);
|
|
3625
|
+
let options_ = {
|
|
3626
|
+
data: content_,
|
|
3627
|
+
method: "POST",
|
|
3628
|
+
url: url_,
|
|
3629
|
+
headers: {
|
|
3630
|
+
"Content-Type": "application/json",
|
|
3631
|
+
"Accept": "application/json"
|
|
3632
|
+
},
|
|
3633
|
+
cancelToken
|
|
3634
|
+
};
|
|
3635
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3636
|
+
return this.instance.request(transformedOptions_);
|
|
3637
|
+
}).catch((_error) => {
|
|
3638
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3639
|
+
return _error.response;
|
|
3640
|
+
}
|
|
3641
|
+
else {
|
|
3642
|
+
throw _error;
|
|
3643
|
+
}
|
|
3644
|
+
}).then((_response) => {
|
|
3645
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateBarcodeItemHandler(_response));
|
|
3646
|
+
});
|
|
3647
|
+
}
|
|
3648
|
+
processUpdateBarcodeItemHandler(response) {
|
|
3649
|
+
const status = response.status;
|
|
3650
|
+
let _headers = {};
|
|
3651
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3652
|
+
for (let k in response.headers) {
|
|
3653
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3654
|
+
_headers[k] = response.headers[k];
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
if (status === 200) {
|
|
3659
|
+
const _responseText = response.data;
|
|
3660
|
+
let result200 = null;
|
|
3661
|
+
let resultData200 = _responseText;
|
|
3662
|
+
result200 = JSON.parse(resultData200);
|
|
3663
|
+
return Promise.resolve(result200);
|
|
3664
|
+
}
|
|
3665
|
+
else if (status !== 200 && status !== 204) {
|
|
3666
|
+
const _responseText = response.data;
|
|
3667
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3668
|
+
}
|
|
3669
|
+
return Promise.resolve(null);
|
|
3670
|
+
}
|
|
3671
|
+
/**
|
|
3672
|
+
* @param tenantId (optional) Tenant identifier
|
|
3673
|
+
* @param body (optional)
|
|
3674
|
+
* @return Success
|
|
3675
|
+
*/
|
|
3676
|
+
updateBoundedTextItemHandler(tenantId, body, cancelToken) {
|
|
3677
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdateBoundedTextItemHandler?";
|
|
3678
|
+
if (tenantId === null)
|
|
3679
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3680
|
+
else if (tenantId !== undefined)
|
|
3681
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3682
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3683
|
+
const content_ = JSON.stringify(body);
|
|
3684
|
+
let options_ = {
|
|
3685
|
+
data: content_,
|
|
3686
|
+
method: "POST",
|
|
3687
|
+
url: url_,
|
|
3688
|
+
headers: {
|
|
3689
|
+
"Content-Type": "application/json",
|
|
3690
|
+
"Accept": "application/json"
|
|
3691
|
+
},
|
|
3692
|
+
cancelToken
|
|
3693
|
+
};
|
|
3694
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3695
|
+
return this.instance.request(transformedOptions_);
|
|
3696
|
+
}).catch((_error) => {
|
|
3697
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3698
|
+
return _error.response;
|
|
3699
|
+
}
|
|
3700
|
+
else {
|
|
3701
|
+
throw _error;
|
|
3702
|
+
}
|
|
3703
|
+
}).then((_response) => {
|
|
3704
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateBoundedTextItemHandler(_response));
|
|
3705
|
+
});
|
|
3706
|
+
}
|
|
3707
|
+
processUpdateBoundedTextItemHandler(response) {
|
|
3708
|
+
const status = response.status;
|
|
3709
|
+
let _headers = {};
|
|
3710
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3711
|
+
for (let k in response.headers) {
|
|
3712
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3713
|
+
_headers[k] = response.headers[k];
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
}
|
|
3717
|
+
if (status === 200) {
|
|
3718
|
+
const _responseText = response.data;
|
|
3719
|
+
let result200 = null;
|
|
3720
|
+
let resultData200 = _responseText;
|
|
3721
|
+
result200 = JSON.parse(resultData200);
|
|
3722
|
+
return Promise.resolve(result200);
|
|
3723
|
+
}
|
|
3724
|
+
else if (status !== 200 && status !== 204) {
|
|
3725
|
+
const _responseText = response.data;
|
|
3726
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3727
|
+
}
|
|
3728
|
+
return Promise.resolve(null);
|
|
3729
|
+
}
|
|
3730
|
+
/**
|
|
3731
|
+
* @param tenantId (optional) Tenant identifier
|
|
3732
|
+
* @param body (optional)
|
|
3733
|
+
* @return Success
|
|
3734
|
+
*/
|
|
3735
|
+
updateByColorData(tenantId, body, cancelToken) {
|
|
3736
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdateByColorData?";
|
|
3737
|
+
if (tenantId === null)
|
|
3738
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3739
|
+
else if (tenantId !== undefined)
|
|
3740
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3741
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3742
|
+
const content_ = JSON.stringify(body);
|
|
3743
|
+
let options_ = {
|
|
3744
|
+
data: content_,
|
|
3745
|
+
method: "POST",
|
|
3746
|
+
url: url_,
|
|
3747
|
+
headers: {
|
|
3748
|
+
"Content-Type": "application/json",
|
|
3749
|
+
"Accept": "application/json"
|
|
3750
|
+
},
|
|
3751
|
+
cancelToken
|
|
3752
|
+
};
|
|
3753
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3754
|
+
return this.instance.request(transformedOptions_);
|
|
3755
|
+
}).catch((_error) => {
|
|
3756
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3757
|
+
return _error.response;
|
|
3758
|
+
}
|
|
3759
|
+
else {
|
|
3760
|
+
throw _error;
|
|
3761
|
+
}
|
|
3762
|
+
}).then((_response) => {
|
|
3763
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateByColorData(_response));
|
|
3764
|
+
});
|
|
3765
|
+
}
|
|
3766
|
+
processUpdateByColorData(response) {
|
|
3767
|
+
const status = response.status;
|
|
3768
|
+
let _headers = {};
|
|
3769
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3770
|
+
for (let k in response.headers) {
|
|
3771
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3772
|
+
_headers[k] = response.headers[k];
|
|
3773
|
+
}
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3776
|
+
if (status === 200) {
|
|
3777
|
+
const _responseText = response.data;
|
|
3778
|
+
let result200 = null;
|
|
3779
|
+
let resultData200 = _responseText;
|
|
3780
|
+
result200 = JSON.parse(resultData200);
|
|
3781
|
+
return Promise.resolve(result200);
|
|
3782
|
+
}
|
|
3783
|
+
else if (status !== 200 && status !== 204) {
|
|
3784
|
+
const _responseText = response.data;
|
|
3785
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3786
|
+
}
|
|
3787
|
+
return Promise.resolve(null);
|
|
3788
|
+
}
|
|
3789
|
+
/**
|
|
3790
|
+
* @param tenantId (optional) Tenant identifier
|
|
3791
|
+
* @param body (optional)
|
|
3792
|
+
* @return Success
|
|
3793
|
+
*/
|
|
3794
|
+
updateByMultiCallRequest(tenantId, body, cancelToken) {
|
|
3795
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdateByMultiCallRequest?";
|
|
3796
|
+
if (tenantId === null)
|
|
3797
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3798
|
+
else if (tenantId !== undefined)
|
|
3799
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3800
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3801
|
+
const content_ = JSON.stringify(body);
|
|
3802
|
+
let options_ = {
|
|
3803
|
+
data: content_,
|
|
3804
|
+
method: "POST",
|
|
3805
|
+
url: url_,
|
|
3806
|
+
headers: {
|
|
3807
|
+
"Content-Type": "application/json",
|
|
3808
|
+
"Accept": "application/json"
|
|
3809
|
+
},
|
|
3810
|
+
cancelToken
|
|
3811
|
+
};
|
|
3812
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3813
|
+
return this.instance.request(transformedOptions_);
|
|
3814
|
+
}).catch((_error) => {
|
|
3815
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3816
|
+
return _error.response;
|
|
3817
|
+
}
|
|
3818
|
+
else {
|
|
3819
|
+
throw _error;
|
|
3820
|
+
}
|
|
3821
|
+
}).then((_response) => {
|
|
3822
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateByMultiCallRequest(_response));
|
|
3823
|
+
});
|
|
3824
|
+
}
|
|
3825
|
+
processUpdateByMultiCallRequest(response) {
|
|
3826
|
+
const status = response.status;
|
|
3827
|
+
let _headers = {};
|
|
3828
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3829
|
+
for (let k in response.headers) {
|
|
3830
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3831
|
+
_headers[k] = response.headers[k];
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3835
|
+
if (status === 200) {
|
|
3836
|
+
const _responseText = response.data;
|
|
3837
|
+
let result200 = null;
|
|
3838
|
+
let resultData200 = _responseText;
|
|
3839
|
+
result200 = JSON.parse(resultData200);
|
|
3840
|
+
return Promise.resolve(result200);
|
|
3841
|
+
}
|
|
3842
|
+
else if (status !== 200 && status !== 204) {
|
|
3843
|
+
const _responseText = response.data;
|
|
3844
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3845
|
+
}
|
|
3846
|
+
return Promise.resolve(null);
|
|
3847
|
+
}
|
|
3848
|
+
/**
|
|
3849
|
+
* @param tenantId (optional) Tenant identifier
|
|
3850
|
+
* @param body (optional)
|
|
3851
|
+
* @return Success
|
|
3852
|
+
*/
|
|
3853
|
+
updateCurvedTextItemHandler(tenantId, body, cancelToken) {
|
|
3854
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdateCurvedTextItemHandler?";
|
|
3855
|
+
if (tenantId === null)
|
|
3856
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3857
|
+
else if (tenantId !== undefined)
|
|
3858
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3859
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3860
|
+
const content_ = JSON.stringify(body);
|
|
3861
|
+
let options_ = {
|
|
3862
|
+
data: content_,
|
|
3863
|
+
method: "POST",
|
|
3864
|
+
url: url_,
|
|
3865
|
+
headers: {
|
|
3866
|
+
"Content-Type": "application/json",
|
|
3867
|
+
"Accept": "application/json"
|
|
3868
|
+
},
|
|
3869
|
+
cancelToken
|
|
3870
|
+
};
|
|
3871
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3872
|
+
return this.instance.request(transformedOptions_);
|
|
3873
|
+
}).catch((_error) => {
|
|
3874
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3875
|
+
return _error.response;
|
|
3876
|
+
}
|
|
3877
|
+
else {
|
|
3878
|
+
throw _error;
|
|
3879
|
+
}
|
|
3880
|
+
}).then((_response) => {
|
|
3881
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateCurvedTextItemHandler(_response));
|
|
3882
|
+
});
|
|
3883
|
+
}
|
|
3884
|
+
processUpdateCurvedTextItemHandler(response) {
|
|
3885
|
+
const status = response.status;
|
|
3886
|
+
let _headers = {};
|
|
3887
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3888
|
+
for (let k in response.headers) {
|
|
3889
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3890
|
+
_headers[k] = response.headers[k];
|
|
3891
|
+
}
|
|
3892
|
+
}
|
|
3893
|
+
}
|
|
3894
|
+
if (status === 200) {
|
|
3895
|
+
const _responseText = response.data;
|
|
3896
|
+
let result200 = null;
|
|
3897
|
+
let resultData200 = _responseText;
|
|
3898
|
+
result200 = JSON.parse(resultData200);
|
|
3899
|
+
return Promise.resolve(result200);
|
|
3900
|
+
}
|
|
3901
|
+
else if (status !== 200 && status !== 204) {
|
|
3902
|
+
const _responseText = response.data;
|
|
3903
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3904
|
+
}
|
|
3905
|
+
return Promise.resolve(null);
|
|
3906
|
+
}
|
|
3907
|
+
/**
|
|
3908
|
+
* @param tenantId (optional) Tenant identifier
|
|
3909
|
+
* @param body (optional)
|
|
3910
|
+
* @return Success
|
|
3911
|
+
*/
|
|
3912
|
+
updateImageItemHandler(tenantId, body, cancelToken) {
|
|
3913
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdateImageItemHandler?";
|
|
3914
|
+
if (tenantId === null)
|
|
3915
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3916
|
+
else if (tenantId !== undefined)
|
|
3917
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3918
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3919
|
+
const content_ = JSON.stringify(body);
|
|
3920
|
+
let options_ = {
|
|
3921
|
+
data: content_,
|
|
3922
|
+
method: "POST",
|
|
3923
|
+
url: url_,
|
|
3924
|
+
headers: {
|
|
3925
|
+
"Content-Type": "application/json",
|
|
3926
|
+
"Accept": "application/json"
|
|
3927
|
+
},
|
|
3928
|
+
cancelToken
|
|
3929
|
+
};
|
|
3930
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3931
|
+
return this.instance.request(transformedOptions_);
|
|
3932
|
+
}).catch((_error) => {
|
|
3933
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3934
|
+
return _error.response;
|
|
3935
|
+
}
|
|
3936
|
+
else {
|
|
3937
|
+
throw _error;
|
|
3938
|
+
}
|
|
3939
|
+
}).then((_response) => {
|
|
3940
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateImageItemHandler(_response));
|
|
3941
|
+
});
|
|
3942
|
+
}
|
|
3943
|
+
processUpdateImageItemHandler(response) {
|
|
3944
|
+
const status = response.status;
|
|
3945
|
+
let _headers = {};
|
|
3946
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3947
|
+
for (let k in response.headers) {
|
|
3948
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3949
|
+
_headers[k] = response.headers[k];
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
}
|
|
3953
|
+
if (status === 200) {
|
|
3954
|
+
const _responseText = response.data;
|
|
3955
|
+
let result200 = null;
|
|
3956
|
+
let resultData200 = _responseText;
|
|
3957
|
+
result200 = JSON.parse(resultData200);
|
|
3958
|
+
return Promise.resolve(result200);
|
|
3959
|
+
}
|
|
3960
|
+
else if (status !== 200 && status !== 204) {
|
|
3961
|
+
const _responseText = response.data;
|
|
3962
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3963
|
+
}
|
|
3964
|
+
return Promise.resolve(null);
|
|
3965
|
+
}
|
|
3966
|
+
/**
|
|
3967
|
+
* @param tenantId (optional) Tenant identifier
|
|
3968
|
+
* @param body (optional)
|
|
3969
|
+
* @return Success
|
|
3970
|
+
*/
|
|
3971
|
+
updatePathBoundedTextItemHandler(tenantId, body, cancelToken) {
|
|
3972
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdatePathBoundedTextItemHandler?";
|
|
3973
|
+
if (tenantId === null)
|
|
3974
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3975
|
+
else if (tenantId !== undefined)
|
|
3976
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3977
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3978
|
+
const content_ = JSON.stringify(body);
|
|
3979
|
+
let options_ = {
|
|
3980
|
+
data: content_,
|
|
3981
|
+
method: "POST",
|
|
3982
|
+
url: url_,
|
|
3983
|
+
headers: {
|
|
3984
|
+
"Content-Type": "application/json",
|
|
3985
|
+
"Accept": "application/json"
|
|
3986
|
+
},
|
|
3987
|
+
cancelToken
|
|
3988
|
+
};
|
|
3989
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3990
|
+
return this.instance.request(transformedOptions_);
|
|
3991
|
+
}).catch((_error) => {
|
|
3992
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3993
|
+
return _error.response;
|
|
3994
|
+
}
|
|
3995
|
+
else {
|
|
3996
|
+
throw _error;
|
|
3997
|
+
}
|
|
3998
|
+
}).then((_response) => {
|
|
3999
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdatePathBoundedTextItemHandler(_response));
|
|
4000
|
+
});
|
|
4001
|
+
}
|
|
4002
|
+
processUpdatePathBoundedTextItemHandler(response) {
|
|
4003
|
+
const status = response.status;
|
|
4004
|
+
let _headers = {};
|
|
4005
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4006
|
+
for (let k in response.headers) {
|
|
4007
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4008
|
+
_headers[k] = response.headers[k];
|
|
4009
|
+
}
|
|
4010
|
+
}
|
|
4011
|
+
}
|
|
4012
|
+
if (status === 200) {
|
|
4013
|
+
const _responseText = response.data;
|
|
4014
|
+
let result200 = null;
|
|
4015
|
+
let resultData200 = _responseText;
|
|
4016
|
+
result200 = JSON.parse(resultData200);
|
|
4017
|
+
return Promise.resolve(result200);
|
|
4018
|
+
}
|
|
4019
|
+
else if (status !== 200 && status !== 204) {
|
|
4020
|
+
const _responseText = response.data;
|
|
4021
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4022
|
+
}
|
|
4023
|
+
return Promise.resolve(null);
|
|
4024
|
+
}
|
|
4025
|
+
/**
|
|
4026
|
+
* @param tenantId (optional) Tenant identifier
|
|
4027
|
+
* @param body (optional)
|
|
4028
|
+
* @return Success
|
|
4029
|
+
*/
|
|
4030
|
+
updatePlainTextItemHandler(tenantId, body, cancelToken) {
|
|
4031
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdatePlainTextItemHandler?";
|
|
4032
|
+
if (tenantId === null)
|
|
4033
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4034
|
+
else if (tenantId !== undefined)
|
|
4035
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4036
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4037
|
+
const content_ = JSON.stringify(body);
|
|
4038
|
+
let options_ = {
|
|
4039
|
+
data: content_,
|
|
4040
|
+
method: "POST",
|
|
4041
|
+
url: url_,
|
|
4042
|
+
headers: {
|
|
4043
|
+
"Content-Type": "application/json",
|
|
4044
|
+
"Accept": "application/json"
|
|
4045
|
+
},
|
|
4046
|
+
cancelToken
|
|
4047
|
+
};
|
|
4048
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4049
|
+
return this.instance.request(transformedOptions_);
|
|
4050
|
+
}).catch((_error) => {
|
|
4051
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4052
|
+
return _error.response;
|
|
4053
|
+
}
|
|
4054
|
+
else {
|
|
4055
|
+
throw _error;
|
|
4056
|
+
}
|
|
4057
|
+
}).then((_response) => {
|
|
4058
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdatePlainTextItemHandler(_response));
|
|
4059
|
+
});
|
|
4060
|
+
}
|
|
4061
|
+
processUpdatePlainTextItemHandler(response) {
|
|
4062
|
+
const status = response.status;
|
|
4063
|
+
let _headers = {};
|
|
4064
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4065
|
+
for (let k in response.headers) {
|
|
4066
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4067
|
+
_headers[k] = response.headers[k];
|
|
4068
|
+
}
|
|
4069
|
+
}
|
|
4070
|
+
}
|
|
4071
|
+
if (status === 200) {
|
|
4072
|
+
const _responseText = response.data;
|
|
4073
|
+
let result200 = null;
|
|
4074
|
+
let resultData200 = _responseText;
|
|
4075
|
+
result200 = JSON.parse(resultData200);
|
|
4076
|
+
return Promise.resolve(result200);
|
|
4077
|
+
}
|
|
4078
|
+
else if (status !== 200 && status !== 204) {
|
|
4079
|
+
const _responseText = response.data;
|
|
4080
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4081
|
+
}
|
|
4082
|
+
return Promise.resolve(null);
|
|
4083
|
+
}
|
|
4084
|
+
/**
|
|
4085
|
+
* @param tenantId (optional) Tenant identifier
|
|
4086
|
+
* @param body (optional)
|
|
4087
|
+
* @return Success
|
|
4088
|
+
*/
|
|
4089
|
+
updateShapeItemHandler(tenantId, body, cancelToken) {
|
|
4090
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/UpdateShapeItemHandler?";
|
|
4091
|
+
if (tenantId === null)
|
|
4092
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4093
|
+
else if (tenantId !== undefined)
|
|
4094
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4095
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4096
|
+
const content_ = JSON.stringify(body);
|
|
4097
|
+
let options_ = {
|
|
4098
|
+
data: content_,
|
|
4099
|
+
method: "POST",
|
|
4100
|
+
url: url_,
|
|
4101
|
+
headers: {
|
|
4102
|
+
"Content-Type": "application/json",
|
|
4103
|
+
"Accept": "application/json"
|
|
4104
|
+
},
|
|
4105
|
+
cancelToken
|
|
4106
|
+
};
|
|
4107
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4108
|
+
return this.instance.request(transformedOptions_);
|
|
4109
|
+
}).catch((_error) => {
|
|
4110
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4111
|
+
return _error.response;
|
|
4112
|
+
}
|
|
4113
|
+
else {
|
|
4114
|
+
throw _error;
|
|
4115
|
+
}
|
|
4116
|
+
}).then((_response) => {
|
|
4117
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateShapeItemHandler(_response));
|
|
4118
|
+
});
|
|
4119
|
+
}
|
|
4120
|
+
processUpdateShapeItemHandler(response) {
|
|
4121
|
+
const status = response.status;
|
|
4122
|
+
let _headers = {};
|
|
4123
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4124
|
+
for (let k in response.headers) {
|
|
4125
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4126
|
+
_headers[k] = response.headers[k];
|
|
4127
|
+
}
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4130
|
+
if (status === 200) {
|
|
4131
|
+
const _responseText = response.data;
|
|
4132
|
+
let result200 = null;
|
|
4133
|
+
let resultData200 = _responseText;
|
|
4134
|
+
result200 = JSON.parse(resultData200);
|
|
4135
|
+
return Promise.resolve(result200);
|
|
4136
|
+
}
|
|
4137
|
+
else if (status !== 200 && status !== 204) {
|
|
4138
|
+
const _responseText = response.data;
|
|
4139
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4140
|
+
}
|
|
4141
|
+
return Promise.resolve(null);
|
|
4142
|
+
}
|
|
4143
|
+
}
|
|
4144
|
+
exports.DesignAtomsViewerApiClient = DesignAtomsViewerApiClient;
|
|
4145
|
+
/** Available patch type */
|
|
4146
|
+
var ProductPatchType;
|
|
4147
|
+
(function (ProductPatchType) {
|
|
4148
|
+
ProductPatchType["Undefined"] = "Undefined";
|
|
4149
|
+
ProductPatchType["ReplaceImageItemFile"] = "ReplaceImageItemFile";
|
|
4150
|
+
})(ProductPatchType = exports.ProductPatchType || (exports.ProductPatchType = {}));
|
|
4151
|
+
var ItemType;
|
|
4152
|
+
(function (ItemType) {
|
|
4153
|
+
ItemType["Image"] = "Image";
|
|
4154
|
+
ItemType["Shape"] = "Shape";
|
|
4155
|
+
ItemType["Clipart"] = "Clipart";
|
|
4156
|
+
ItemType["Group"] = "Group";
|
|
4157
|
+
})(ItemType = exports.ItemType || (exports.ItemType = {}));
|
|
4158
|
+
/** Item souce types */
|
|
4159
|
+
var ItemSourceType;
|
|
4160
|
+
(function (ItemSourceType) {
|
|
4161
|
+
ItemSourceType["File"] = "File";
|
|
4162
|
+
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
4163
|
+
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
4164
|
+
})(ItemSourceType = exports.ItemSourceType || (exports.ItemSourceType = {}));
|
|
4165
|
+
var ProductProofFormat;
|
|
4166
|
+
(function (ProductProofFormat) {
|
|
4167
|
+
ProductProofFormat["Jpeg"] = "Jpeg";
|
|
4168
|
+
ProductProofFormat["Png"] = "Png";
|
|
4169
|
+
ProductProofFormat["Tiff"] = "Tiff";
|
|
4170
|
+
ProductProofFormat["Pdf"] = "Pdf";
|
|
4171
|
+
})(ProductProofFormat = exports.ProductProofFormat || (exports.ProductProofFormat = {}));
|
|
4172
|
+
var ProductProofInterpolationMode;
|
|
4173
|
+
(function (ProductProofInterpolationMode) {
|
|
4174
|
+
ProductProofInterpolationMode["High"] = "High";
|
|
4175
|
+
ProductProofInterpolationMode["Medium"] = "Medium";
|
|
4176
|
+
ProductProofInterpolationMode["Low"] = "Low";
|
|
4177
|
+
ProductProofInterpolationMode["NearestNeighbour"] = "NearestNeighbour";
|
|
4178
|
+
ProductProofInterpolationMode["Linear"] = "Linear";
|
|
4179
|
+
ProductProofInterpolationMode["Cubic"] = "Cubic";
|
|
4180
|
+
ProductProofInterpolationMode["Supersampling"] = "Supersampling";
|
|
4181
|
+
ProductProofInterpolationMode["Lanczos"] = "Lanczos";
|
|
4182
|
+
ProductProofInterpolationMode["Anisotropic4"] = "Anisotropic4";
|
|
4183
|
+
ProductProofInterpolationMode["Anisotropic9"] = "Anisotropic9";
|
|
4184
|
+
ProductProofInterpolationMode["Lanczos3"] = "Lanczos3";
|
|
4185
|
+
})(ProductProofInterpolationMode = exports.ProductProofInterpolationMode || (exports.ProductProofInterpolationMode = {}));
|
|
4186
|
+
class ApiException extends Error {
|
|
4187
|
+
message;
|
|
4188
|
+
status;
|
|
4189
|
+
response;
|
|
4190
|
+
headers;
|
|
4191
|
+
result;
|
|
4192
|
+
constructor(message, status, response, headers, result) {
|
|
4193
|
+
super();
|
|
4194
|
+
this.message = message;
|
|
4195
|
+
this.status = status;
|
|
4196
|
+
this.response = response;
|
|
4197
|
+
this.headers = headers;
|
|
4198
|
+
this.result = result;
|
|
4199
|
+
}
|
|
4200
|
+
isApiException = true;
|
|
4201
|
+
static isApiException(obj) {
|
|
4202
|
+
return obj.isApiException === true;
|
|
4203
|
+
}
|
|
4204
|
+
}
|
|
4205
|
+
exports.ApiException = ApiException;
|
|
4206
|
+
function throwException(message, status, response, headers, result) {
|
|
4207
|
+
if (result !== null && result !== undefined)
|
|
4208
|
+
throw result;
|
|
4209
|
+
else
|
|
4210
|
+
throw new ApiException(message, status, response, headers, null);
|
|
4211
|
+
}
|
|
4212
|
+
function isAxiosError(obj) {
|
|
4213
|
+
return obj && obj.isAxiosError === true;
|
|
4214
|
+
}
|
|
4215
|
+
//# sourceMappingURL=design-atoms-api-client.js.map
|