@shapediver/sdk.geometry-api-sdk-v2 3.7.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/UtilsApi.d.ts +19 -29
- package/dist/UtilsApi.d.ts.map +1 -1
- package/dist/UtilsApi.js +140 -135
- package/dist/UtilsApi.js.map +1 -1
- package/dist/base.d.ts +2 -5
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +30 -36
- package/dist/base.js.map +1 -1
- package/dist/client/apis/AnalyticsApi.d.ts +38 -0
- package/dist/client/apis/AnalyticsApi.d.ts.map +1 -0
- package/dist/client/apis/AnalyticsApi.js +245 -0
- package/dist/client/apis/AnalyticsApi.js.map +1 -0
- package/dist/client/apis/ArSceneApi.d.ts +23 -0
- package/dist/client/apis/ArSceneApi.d.ts.map +1 -0
- package/dist/client/apis/ArSceneApi.js +140 -0
- package/dist/client/apis/ArSceneApi.js.map +1 -0
- package/dist/client/apis/AssetsApi.d.ts +54 -0
- package/dist/client/apis/AssetsApi.d.ts.map +1 -0
- package/dist/client/apis/AssetsApi.js +329 -0
- package/dist/client/apis/AssetsApi.js.map +1 -0
- package/dist/client/apis/AuthApi.d.ts +8 -0
- package/dist/client/apis/AuthApi.d.ts.map +1 -0
- package/dist/client/apis/AuthApi.js +77 -0
- package/dist/client/apis/AuthApi.js.map +1 -0
- package/dist/client/apis/AuthGroupApi.d.ts +12 -0
- package/dist/client/apis/AuthGroupApi.d.ts.map +1 -0
- package/dist/client/apis/AuthGroupApi.js +89 -0
- package/dist/client/apis/AuthGroupApi.js.map +1 -0
- package/dist/client/apis/ExportApi.d.ts +38 -0
- package/dist/client/apis/ExportApi.d.ts.map +1 -0
- package/dist/client/apis/ExportApi.js +230 -0
- package/dist/client/apis/ExportApi.js.map +1 -0
- package/dist/client/apis/FileApi.d.ts +45 -0
- package/dist/client/apis/FileApi.d.ts.map +1 -0
- package/dist/client/apis/FileApi.js +271 -0
- package/dist/client/apis/FileApi.js.map +1 -0
- package/dist/client/apis/GltfApi.d.ts +14 -0
- package/dist/client/apis/GltfApi.d.ts.map +1 -0
- package/dist/client/apis/GltfApi.js +96 -0
- package/dist/client/apis/GltfApi.js.map +1 -0
- package/dist/client/apis/LogApi.d.ts +13 -0
- package/dist/client/apis/LogApi.d.ts.map +1 -0
- package/dist/client/apis/LogApi.js +93 -0
- package/dist/client/apis/LogApi.js.map +1 -0
- package/dist/client/apis/ModelApi.d.ts +129 -0
- package/dist/client/apis/ModelApi.d.ts.map +1 -0
- package/dist/client/apis/ModelApi.js +762 -0
- package/dist/client/apis/ModelApi.js.map +1 -0
- package/dist/client/apis/ModelStateApi.d.ts +57 -0
- package/dist/client/apis/ModelStateApi.d.ts.map +1 -0
- package/dist/client/apis/ModelStateApi.js +328 -0
- package/dist/client/apis/ModelStateApi.js.map +1 -0
- package/dist/client/apis/OutputApi.d.ts +38 -0
- package/dist/client/apis/OutputApi.d.ts.map +1 -0
- package/dist/client/apis/OutputApi.js +230 -0
- package/dist/client/apis/OutputApi.js.map +1 -0
- package/dist/client/apis/ScriptApi.d.ts +17 -0
- package/dist/client/apis/ScriptApi.d.ts.map +1 -0
- package/dist/client/apis/ScriptApi.js +127 -0
- package/dist/client/apis/ScriptApi.js.map +1 -0
- package/dist/client/apis/SdtfApi.d.ts +37 -0
- package/dist/client/apis/SdtfApi.d.ts.map +1 -0
- package/dist/client/apis/SdtfApi.js +227 -0
- package/dist/client/apis/SdtfApi.js.map +1 -0
- package/dist/client/apis/SessionApi.d.ts +51 -0
- package/dist/client/apis/SessionApi.d.ts.map +1 -0
- package/dist/client/apis/SessionApi.js +300 -0
- package/dist/client/apis/SessionApi.js.map +1 -0
- package/dist/client/apis/SystemApi.d.ts +28 -0
- package/dist/client/apis/SystemApi.d.ts.map +1 -0
- package/dist/client/apis/SystemApi.js +235 -0
- package/dist/client/apis/SystemApi.js.map +1 -0
- package/dist/client/apis/TextureApi.d.ts +13 -0
- package/dist/client/apis/TextureApi.d.ts.map +1 -0
- package/dist/client/apis/TextureApi.js +91 -0
- package/dist/client/apis/TextureApi.js.map +1 -0
- package/dist/client/apis/index.d.ts +18 -0
- package/dist/client/apis/index.d.ts.map +1 -0
- package/dist/client/apis/index.js +34 -0
- package/dist/client/apis/index.js.map +1 -0
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/models/index.d.ts +1671 -0
- package/dist/client/models/index.d.ts.map +1 -0
- package/dist/client/models/index.js +239 -0
- package/dist/client/models/index.js.map +1 -0
- package/dist/client/runtime.d.ts +154 -0
- package/dist/client/runtime.d.ts.map +1 -0
- package/dist/client/runtime.js +323 -0
- package/dist/client/runtime.js.map +1 -0
- package/dist/configuration.d.ts +2 -7
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js +21 -16
- package/dist/configuration.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +2 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +16 -13
- package/dist/utils.js.map +1 -1
- package/package.json +3 -9
- package/src/UtilsApi.ts +265 -318
- package/src/base.ts +48 -46
- package/src/client/apis/AnalyticsApi.ts +347 -0
- package/src/client/apis/ArSceneApi.ts +172 -0
- package/src/client/apis/AssetsApi.ts +474 -0
- package/src/client/apis/AuthApi.ts +63 -0
- package/src/client/apis/AuthGroupApi.ts +89 -0
- package/src/client/apis/ExportApi.ts +332 -0
- package/src/client/apis/FileApi.ts +401 -0
- package/src/client/apis/GltfApi.ts +101 -0
- package/src/client/apis/LogApi.ts +96 -0
- package/src/client/apis/ModelApi.ts +1206 -0
- package/src/client/apis/ModelStateApi.ts +479 -0
- package/src/client/apis/OutputApi.ts +333 -0
- package/src/client/apis/ScriptApi.ts +142 -0
- package/src/client/apis/SdtfApi.ts +327 -0
- package/src/client/apis/SessionApi.ts +435 -0
- package/src/client/apis/SystemApi.ts +301 -0
- package/src/client/apis/TextureApi.ts +91 -0
- package/src/client/apis/index.ts +19 -0
- package/src/client/index.ts +3 -16
- package/src/client/models/index.ts +7367 -0
- package/src/client/runtime.ts +442 -0
- package/src/configuration.ts +31 -38
- package/src/error.ts +2 -2
- package/src/index.ts +2 -1
- package/src/utils.ts +53 -25
- package/dist/client/api.d.ts +0 -2111
- package/dist/client/api.d.ts.map +0 -1
- package/dist/client/api.js +0 -3576
- package/dist/client/api.js.map +0 -1
- package/dist/client/base.d.ts +0 -32
- package/dist/client/base.d.ts.map +0 -1
- package/dist/client/base.js +0 -37
- package/dist/client/base.js.map +0 -1
- package/dist/client/common.d.ts +0 -15
- package/dist/client/common.d.ts.map +0 -1
- package/dist/client/common.js +0 -117
- package/dist/client/common.js.map +0 -1
- package/dist/client/configuration.d.ts +0 -37
- package/dist/client/configuration.d.ts.map +0 -1
- package/dist/client/configuration.js +0 -23
- package/dist/client/configuration.js.map +0 -1
- package/src/client/api.ts +0 -11052
- package/src/client/base.ts +0 -62
- package/src/client/common.ts +0 -127
- package/src/client/configuration.ts +0 -121
package/src/UtilsApi.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAPI } from './base';
|
|
2
2
|
import {
|
|
3
3
|
AssetsApi,
|
|
4
|
-
Configuration,
|
|
5
4
|
ExportApi,
|
|
6
5
|
OutputApi,
|
|
7
6
|
ReqCache,
|
|
@@ -14,14 +13,13 @@ import {
|
|
|
14
13
|
ResGetCachedExports,
|
|
15
14
|
ResGetCachedOutputs,
|
|
16
15
|
ResOutput,
|
|
17
|
-
} from './client';
|
|
18
|
-
import { BaseAPI, RequestArgs } from './client/base';
|
|
16
|
+
} from './client/index';
|
|
19
17
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from './
|
|
24
|
-
import { IllegalArgumentError,
|
|
18
|
+
Configuration as ClientConfig,
|
|
19
|
+
ResponseError as ClientResponseError,
|
|
20
|
+
} from './client/runtime';
|
|
21
|
+
import { Configuration } from './configuration';
|
|
22
|
+
import { IllegalArgumentError, TimeoutError } from './error';
|
|
25
23
|
import { contentDispositionFromFilename, sleep } from './utils';
|
|
26
24
|
|
|
27
25
|
/* Regex patterns for different asset types targeting the ShapeDiver API. */
|
|
@@ -41,156 +39,100 @@ const directDownloadUri = /^(http[s]?:\/\/)?(viewer|textures|downloads)\.shapedi
|
|
|
41
39
|
/* Regex pattern for ShapeDiver no-CDN servers. */
|
|
42
40
|
const sdNoCdnOrigin = /-nocdn.[\w-]+.shapediver.com$/;
|
|
43
41
|
|
|
42
|
+
/** List of headers to remove before sending the request. */
|
|
43
|
+
type DisableHeaders = string[];
|
|
44
|
+
|
|
44
45
|
export class UtilsApi extends BaseAPI {
|
|
45
|
-
constructor(
|
|
46
|
-
super(
|
|
46
|
+
constructor(config?: Configuration | ClientConfig) {
|
|
47
|
+
super(config);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* Upload the given file to the specified URL.
|
|
51
52
|
*
|
|
52
53
|
* _Note: This method does not use the `UtilsApi`'s base configuration._
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
54
|
+
* @param url The target URL of the upload request.
|
|
55
|
+
* @param data The data that should be uploaded.
|
|
56
|
+
* @param contentType Indicate the original media type of the resource.
|
|
57
|
+
* @param [filename] The name of the file to be uploaded. When a filename has been specified in the request-upload call, then the same filename has to be specified for the upload as well.
|
|
58
|
+
* @param [options] Override http request option.
|
|
58
59
|
*/
|
|
59
60
|
public upload(
|
|
60
61
|
url: string,
|
|
61
62
|
data: any,
|
|
62
63
|
contentType: string,
|
|
63
64
|
filename?: string,
|
|
64
|
-
options
|
|
65
|
-
):
|
|
65
|
+
options: RequestInit = {}
|
|
66
|
+
): Promise<Response> {
|
|
66
67
|
// Prepare headers for the upload.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
'X-ShapeDiver-Origin': undefined,
|
|
72
|
-
'X-ShapeDiver-SessionEngineId': undefined,
|
|
73
|
-
'X-ShapeDiver-BuildVersion': undefined,
|
|
74
|
-
'X-ShapeDiver-BuildDate': undefined,
|
|
75
|
-
'X-ShapeDiver-UserAgent': undefined,
|
|
76
|
-
};
|
|
77
|
-
if (filename) reqHeaders['Content-Disposition'] = contentDispositionFromFilename(filename);
|
|
68
|
+
options.headers = new Headers(options.headers);
|
|
69
|
+
options.headers.set('Content-Type', contentType);
|
|
70
|
+
if (filename)
|
|
71
|
+
options.headers.set('Content-Disposition', contentDispositionFromFilename(filename));
|
|
78
72
|
|
|
79
|
-
const
|
|
80
|
-
|
|
73
|
+
const disableHeaders: DisableHeaders = [
|
|
74
|
+
'Authorization', // Disable by default to avoid accidental token exposure.
|
|
81
75
|
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
/* Override custom ShapeDiver headers to avoid CORS issues. */
|
|
77
|
+
'X-ShapeDiver-Origin',
|
|
78
|
+
'X-ShapeDiver-SessionEngineId',
|
|
79
|
+
'X-ShapeDiver-BuildVersion',
|
|
80
|
+
'X-ShapeDiver-BuildDate',
|
|
81
|
+
'X-ShapeDiver-UserAgent',
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
return this.fetchRequest("PUT", url, data, options, disableHeaders);
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
/**
|
|
87
88
|
* Upload the given asset to the specified ShapeDiver URL.
|
|
88
89
|
*
|
|
89
90
|
* _Note: This method does not use the `UtilsApi`'s base configuration._
|
|
90
|
-
* @param
|
|
91
|
-
* @param
|
|
92
|
-
* @param
|
|
93
|
-
* @param
|
|
91
|
+
* @param url The target URL of the upload request.
|
|
92
|
+
* @param data The data that should be uploaded.
|
|
93
|
+
* @param headers The headers object that was returned from the request-upload call.
|
|
94
|
+
* @param [options] Override http request option.
|
|
94
95
|
*/
|
|
95
96
|
public uploadAsset(
|
|
96
97
|
url: string,
|
|
97
98
|
data: any,
|
|
98
99
|
headers: ResAssetUploadHeaders,
|
|
99
|
-
options
|
|
100
|
-
):
|
|
100
|
+
options: RequestInit = {}
|
|
101
|
+
): Promise<Response> {
|
|
101
102
|
// Prepare headers for the upload.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
'X-ShapeDiver-SessionEngineId': undefined,
|
|
108
|
-
'X-ShapeDiver-BuildVersion': undefined,
|
|
109
|
-
'X-ShapeDiver-BuildDate': undefined,
|
|
110
|
-
'X-ShapeDiver-UserAgent': undefined,
|
|
111
|
-
};
|
|
112
|
-
if (headers.contentDisposition)
|
|
113
|
-
reqHeaders['Content-Disposition'] = headers.contentDisposition;
|
|
103
|
+
options.headers = new Headers(options.headers);
|
|
104
|
+
options.headers.set('Content-Type', headers.contentType);
|
|
105
|
+
if (headers.contentDisposition) {
|
|
106
|
+
options.headers.set('Content-Disposition', headers.contentDisposition);
|
|
107
|
+
}
|
|
114
108
|
|
|
115
|
-
const
|
|
116
|
-
|
|
109
|
+
const disableHeaders: DisableHeaders = [
|
|
110
|
+
'Authorization', // Disable by default to avoid accidental token exposure.
|
|
117
111
|
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
/* Override custom ShapeDiver headers to avoid CORS issues. */
|
|
113
|
+
'X-ShapeDiver-Origin',
|
|
114
|
+
'X-ShapeDiver-SessionEngineId',
|
|
115
|
+
'X-ShapeDiver-BuildVersion',
|
|
116
|
+
'X-ShapeDiver-BuildDate',
|
|
117
|
+
'X-ShapeDiver-UserAgent',
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
return this.fetchRequest("PUT", url, data, options, disableHeaders);
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
/**
|
|
123
124
|
* Downloads data from the specified URL.
|
|
124
125
|
*
|
|
125
|
-
*
|
|
126
|
-
* @param
|
|
127
|
-
* @
|
|
128
|
-
* @throws {ResponseError} if the response type cannot be handled, such as when JSON parsing
|
|
126
|
+
* @param url The URL to download from.
|
|
127
|
+
* @param [options] Optional HTTP request overrides.
|
|
128
|
+
* @throws ResponseError if the response type cannot be handled, such as when JSON parsing
|
|
129
129
|
* fails.
|
|
130
130
|
*/
|
|
131
|
-
public download(
|
|
132
|
-
|
|
133
|
-
options
|
|
134
|
-
): AxiosPromise<ArrayBuffer>;
|
|
135
|
-
public download(
|
|
136
|
-
url: string,
|
|
137
|
-
options: { responseType: 'json' } & RawAxiosRequestConfig
|
|
138
|
-
): AxiosPromise<Record<string, any>>;
|
|
139
|
-
public download(
|
|
140
|
-
url: string,
|
|
141
|
-
options: { responseType: 'text' } & RawAxiosRequestConfig
|
|
142
|
-
): AxiosPromise<string>;
|
|
143
|
-
public download(url: string, options?: RawAxiosRequestConfig): AxiosPromise<any>;
|
|
144
|
-
public async download(url: string, options?: RawAxiosRequestConfig): AxiosPromise<any> {
|
|
145
|
-
const localRequestOptions = await this.buildRequestOptions(url, options ?? {});
|
|
146
|
-
this.disableAuthHeaderForShapeDiverUris(url, localRequestOptions);
|
|
147
|
-
|
|
148
|
-
const request = this.buildRequest('GET', url, undefined, localRequestOptions)();
|
|
149
|
-
const res = request();
|
|
150
|
-
|
|
151
|
-
// Convert Buffer to ArrayBuffer in Node.js when responseType is 'arraybuffer'
|
|
152
|
-
if (options?.responseType === 'arraybuffer') {
|
|
153
|
-
return res.then((response) => {
|
|
154
|
-
const data = response.data;
|
|
155
|
-
|
|
156
|
-
// In Node.js, Axios returns a Buffer for arraybuffer responseType
|
|
157
|
-
// Convert it to ArrayBuffer for consistency with browser behavior
|
|
158
|
-
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(data)) {
|
|
159
|
-
// Convert Buffer to ArrayBuffer by copying to a new Uint8Array
|
|
160
|
-
const uint8Array = new Uint8Array(data);
|
|
161
|
-
response.data = uint8Array.buffer;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
return response;
|
|
165
|
-
});
|
|
166
|
-
}
|
|
131
|
+
public async download(url: string, options: RequestInit = {}): Promise<Response> {
|
|
132
|
+
const disableHeaders: DisableHeaders = [];
|
|
133
|
+
this.disableAuthHeaderForShapeDiverUris(url, options, disableHeaders);
|
|
167
134
|
|
|
168
|
-
|
|
169
|
-
if (options?.responseType === 'json') {
|
|
170
|
-
return res.then((response) => {
|
|
171
|
-
const data = response.data;
|
|
172
|
-
|
|
173
|
-
// Throw a single error if the response is not valid JSON (object or array)
|
|
174
|
-
if (
|
|
175
|
-
data === null ||
|
|
176
|
-
data === undefined ||
|
|
177
|
-
typeof data === 'string' ||
|
|
178
|
-
data instanceof ArrayBuffer ||
|
|
179
|
-
(typeof Buffer !== 'undefined' && Buffer.isBuffer(data)) ||
|
|
180
|
-
(typeof Blob !== 'undefined' && data instanceof Blob)
|
|
181
|
-
) {
|
|
182
|
-
throw new ResponseError(
|
|
183
|
-
response.status,
|
|
184
|
-
'Invalid JSON response: Could not parse response as JSON',
|
|
185
|
-
'Expected valid JSON but received incompatible response'
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return response;
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return res;
|
|
135
|
+
return await this.fetchRequest("GET", url, undefined, options, disableHeaders);
|
|
194
136
|
}
|
|
195
137
|
|
|
196
138
|
/**
|
|
@@ -198,22 +140,14 @@ export class UtilsApi extends BaseAPI {
|
|
|
198
140
|
* the asset is determined by the URL and returned with the promise.
|
|
199
141
|
*
|
|
200
142
|
* The response type can be controlled by setting the `responseType` in the `options` object.
|
|
201
|
-
* @param
|
|
202
|
-
* @param
|
|
203
|
-
* @throws
|
|
143
|
+
* @param url The URL of the asset to download.
|
|
144
|
+
* @param [options] Override http request option.
|
|
145
|
+
* @throws IllegalArgumentError in case the URL is not a valid ShapeDiver asset URL.
|
|
204
146
|
*/
|
|
205
147
|
public downloadAsset(
|
|
206
148
|
url: string,
|
|
207
|
-
options
|
|
208
|
-
): [
|
|
209
|
-
public downloadAsset(
|
|
210
|
-
url: string,
|
|
211
|
-
options?: RawAxiosRequestConfig
|
|
212
|
-
): [AxiosPromise<any>, 'export' | 'output' | 'texture'];
|
|
213
|
-
public downloadAsset(
|
|
214
|
-
url: string,
|
|
215
|
-
options?: RawAxiosRequestConfig
|
|
216
|
-
): [AxiosPromise<any>, 'export' | 'output' | 'texture'] {
|
|
149
|
+
options?: RequestInit
|
|
150
|
+
): [Promise<Response>, 'export' | 'output' | 'texture'] {
|
|
217
151
|
let type: 'output' | 'export' | 'texture';
|
|
218
152
|
|
|
219
153
|
// Check if the given URL is a valid API or CDN asset URL
|
|
@@ -226,7 +160,7 @@ export class UtilsApi extends BaseAPI {
|
|
|
226
160
|
);
|
|
227
161
|
}
|
|
228
162
|
|
|
229
|
-
return [this.download(url, options)
|
|
163
|
+
return [this.download(url, options), type];
|
|
230
164
|
}
|
|
231
165
|
|
|
232
166
|
/**
|
|
@@ -234,83 +168,90 @@ export class UtilsApi extends BaseAPI {
|
|
|
234
168
|
* URLs to the `AssetsApi.downloadImage` endpoint to avoid CORS issues.
|
|
235
169
|
*
|
|
236
170
|
* The response type can be controlled by setting the `responseType` in the `options` object.
|
|
237
|
-
* @param
|
|
238
|
-
* @param
|
|
239
|
-
* @param
|
|
171
|
+
* @param sessionId The session ID.
|
|
172
|
+
* @param url The URL of the image to download.
|
|
173
|
+
* @param [options] Override http request option and set response-type.
|
|
240
174
|
*/
|
|
241
175
|
public downloadImage(
|
|
242
176
|
sessionId: string,
|
|
243
177
|
url: string,
|
|
244
|
-
options
|
|
245
|
-
):
|
|
178
|
+
options?: RequestInit
|
|
179
|
+
): Promise<Blob>;
|
|
246
180
|
public downloadImage(
|
|
247
181
|
sessionId: string,
|
|
248
182
|
url: string,
|
|
249
|
-
options
|
|
250
|
-
):
|
|
251
|
-
public downloadImage(
|
|
183
|
+
options: RequestInit & { responseType: "arraybuffer" }
|
|
184
|
+
): Promise<ArrayBuffer>;
|
|
185
|
+
public async downloadImage(
|
|
252
186
|
sessionId: string,
|
|
253
187
|
url: string,
|
|
254
|
-
options?:
|
|
255
|
-
):
|
|
188
|
+
options: RequestInit & { responseType?: 'arraybuffer' } = {}
|
|
189
|
+
): Promise<Blob | ArrayBuffer> {
|
|
190
|
+
const responseType = options.responseType;
|
|
256
191
|
if (
|
|
257
192
|
apiAssetTextureUri.test(url) ||
|
|
258
193
|
cdnAssetTextureUri.test(url) ||
|
|
259
194
|
directDownloadUri.test(url)
|
|
260
195
|
) {
|
|
261
196
|
// Call ShapeDiver texture-asset URLs directly
|
|
262
|
-
|
|
197
|
+
const response = await this.download(url, options);
|
|
198
|
+
|
|
199
|
+
return responseType === 'arraybuffer'
|
|
200
|
+
? response.arrayBuffer()
|
|
201
|
+
: response.blob();
|
|
263
202
|
} else {
|
|
264
203
|
/* All other source URLs are called via the download-image endpoint */
|
|
265
204
|
|
|
266
|
-
const localOptions: RawAxiosRequestConfig = options ?? {};
|
|
267
|
-
this.disableAuthHeaderForShapeDiverUris(url, localOptions);
|
|
268
|
-
|
|
269
205
|
// Use a universal base64 encoder for browser and Node.js environments
|
|
270
206
|
const encodedUrl =
|
|
271
207
|
typeof window !== 'undefined' && window.btoa
|
|
272
208
|
? window.btoa(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
209
|
+
encodeURIComponent(url).replace(/%([0-9A-F]{2})/g, (_, p1) =>
|
|
210
|
+
String.fromCharCode(parseInt(p1, 16))
|
|
211
|
+
)
|
|
212
|
+
)
|
|
277
213
|
: Buffer.from(url, 'utf-8').toString('base64');
|
|
278
214
|
|
|
279
|
-
|
|
215
|
+
// Remove the authrization header from all configurations.
|
|
216
|
+
const config = new Configuration(this.configuration);
|
|
217
|
+
if (config.headers && config.headers['Authorization'])
|
|
218
|
+
delete config.headers!['Authrization'];
|
|
219
|
+
|
|
220
|
+
const image = await new AssetsApi(config).downloadImage(
|
|
280
221
|
sessionId,
|
|
281
222
|
encodedUrl,
|
|
282
|
-
|
|
223
|
+
options
|
|
283
224
|
);
|
|
225
|
+
|
|
226
|
+
return responseType === 'arraybuffer'
|
|
227
|
+
? await image.arrayBuffer()
|
|
228
|
+
: image;
|
|
284
229
|
}
|
|
285
230
|
}
|
|
286
231
|
|
|
287
232
|
/**
|
|
288
233
|
* Submit a customization request and wait for the result to be finished.
|
|
289
|
-
* @param
|
|
290
|
-
* @param
|
|
291
|
-
* @param
|
|
292
|
-
* @param
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
* @param {*} [options] Override http request option.
|
|
296
|
-
* @throws {TimeoutError} in case a maximum duration has been specified and is exceeded.
|
|
234
|
+
* @param sessionId The session ID.
|
|
235
|
+
* @param body The body of the customization request.
|
|
236
|
+
* @param [maxWaitMsec=-1] Maximum duration to wait for result (in milliseconds), pass value < 0 to disable limit.
|
|
237
|
+
* @param [ignoreUnknownParams=false] Allow relaxed validation of parameter identifiers. When set to `true`, unrecognized parameters will be ignored rather than causing an error. Defaults to `false`.
|
|
238
|
+
* @param [options] Override http request option.
|
|
239
|
+
* @throws TimeoutError in case a maximum duration has been specified and is exceeded.
|
|
297
240
|
*/
|
|
298
241
|
public async submitAndWaitForOutput(
|
|
299
242
|
sessionId: string,
|
|
300
243
|
body: ReqCustomization,
|
|
301
244
|
maxWaitMsec = -1,
|
|
302
245
|
ignoreUnknownParams?: boolean,
|
|
303
|
-
options?:
|
|
246
|
+
options?: RequestInit
|
|
304
247
|
): Promise<ResComputeOutputs> {
|
|
305
248
|
const startMsec = Date.now();
|
|
306
|
-
const dto = (
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
)
|
|
313
|
-
).data;
|
|
249
|
+
const dto = await new OutputApi(this.configuration).computeOutputs(
|
|
250
|
+
sessionId,
|
|
251
|
+
body,
|
|
252
|
+
ignoreUnknownParams,
|
|
253
|
+
options
|
|
254
|
+
);
|
|
314
255
|
const waitMsec = Date.now() - startMsec;
|
|
315
256
|
|
|
316
257
|
// Reduce the total max waiting time by the amount the customization-request took
|
|
@@ -321,31 +262,27 @@ export class UtilsApi extends BaseAPI {
|
|
|
321
262
|
|
|
322
263
|
/**
|
|
323
264
|
* Submit an export request and wait for the result to be finished.
|
|
324
|
-
* @param
|
|
325
|
-
* @param
|
|
326
|
-
* @param
|
|
327
|
-
* @param
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
* @param {*} [options] Override http request option.
|
|
331
|
-
* @throws {TimeoutError} in case a maximum duration has been specified and is exceeded.
|
|
265
|
+
* @param sessionId The session ID.
|
|
266
|
+
* @param body The body of the export request.
|
|
267
|
+
* @param [maxWaitMsec=-1] Maximum duration to wait for result (in milliseconds), pass value < 0 to disable limit.
|
|
268
|
+
* @param [ignoreUnknownParams=false] Allow relaxed validation of parameter identifiers. When set to `true`, unrecognized parameters will be ignored rather than causing an error. Defaults to `false`.
|
|
269
|
+
* @param [options] Override http request option.
|
|
270
|
+
* @throws TimeoutError in case a maximum duration has been specified and is exceeded.
|
|
332
271
|
*/
|
|
333
272
|
public async submitAndWaitForExport(
|
|
334
273
|
sessionId: string,
|
|
335
274
|
body: ReqExport,
|
|
336
275
|
maxWaitMsec = -1,
|
|
337
276
|
ignoreUnknownParams?: boolean,
|
|
338
|
-
options?:
|
|
277
|
+
options?: RequestInit
|
|
339
278
|
): Promise<ResComputeExports> {
|
|
340
279
|
const startMsec = Date.now();
|
|
341
|
-
const dto = (
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
)
|
|
348
|
-
).data;
|
|
280
|
+
const dto = await new ExportApi(this.configuration).computeExports(
|
|
281
|
+
sessionId,
|
|
282
|
+
body,
|
|
283
|
+
ignoreUnknownParams,
|
|
284
|
+
options
|
|
285
|
+
);
|
|
349
286
|
const waitMsec = Date.now() - startMsec;
|
|
350
287
|
|
|
351
288
|
// Reduce the total max waiting time by the amount the compute-request took
|
|
@@ -356,17 +293,17 @@ export class UtilsApi extends BaseAPI {
|
|
|
356
293
|
|
|
357
294
|
/**
|
|
358
295
|
* Given a DTO resulting from a customization request, wait for the results to be finished.
|
|
359
|
-
* @param
|
|
360
|
-
* @param
|
|
361
|
-
* @param
|
|
362
|
-
* @param
|
|
363
|
-
* @throws
|
|
296
|
+
* @param sessionId The session ID.
|
|
297
|
+
* @param dto The DTO resulting from a customization request.
|
|
298
|
+
* @param [maxWaitMsec=-1] Maximum duration to wait for result (in milliseconds), pass value < 0 to disable limit.
|
|
299
|
+
* @param [options] Override http request option.
|
|
300
|
+
* @throws TimeoutError in case a maximum duration has been specified and is exceeded.
|
|
364
301
|
*/
|
|
365
302
|
private async waitForOutputResult(
|
|
366
303
|
sessionId: string,
|
|
367
304
|
dto: ResComputeOutputs,
|
|
368
305
|
maxWaitMsec: number,
|
|
369
|
-
options?:
|
|
306
|
+
options?: RequestInit
|
|
370
307
|
): Promise<ResComputeOutputs> {
|
|
371
308
|
if (!dto.outputs) return dto;
|
|
372
309
|
|
|
@@ -394,13 +331,11 @@ export class UtilsApi extends BaseAPI {
|
|
|
394
331
|
await sleep(delay);
|
|
395
332
|
|
|
396
333
|
// Send cache request
|
|
397
|
-
dto = (
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
)
|
|
403
|
-
).data;
|
|
334
|
+
dto = await new OutputApi(this.configuration).getCachedOutputs(
|
|
335
|
+
sessionId,
|
|
336
|
+
outputVersions,
|
|
337
|
+
options
|
|
338
|
+
)
|
|
404
339
|
delay = this.getMaxOutputDelay(dto);
|
|
405
340
|
}
|
|
406
341
|
|
|
@@ -409,19 +344,19 @@ export class UtilsApi extends BaseAPI {
|
|
|
409
344
|
|
|
410
345
|
/**
|
|
411
346
|
* Given a DTO resulting from an export request, wait for the result to be finished.
|
|
412
|
-
* @param
|
|
413
|
-
* @param
|
|
414
|
-
* @param
|
|
415
|
-
* @param
|
|
416
|
-
* @param
|
|
417
|
-
* @throws
|
|
347
|
+
* @param sessionId The session ID.
|
|
348
|
+
* @param body The body of the export request.
|
|
349
|
+
* @param dto The DTO resulting from an export request.
|
|
350
|
+
* @param [maxWaitMsec=-1] Maximum duration to wait for result (in milliseconds), pass value < 0 to disable limit.
|
|
351
|
+
* @param [options] Override http request option.
|
|
352
|
+
* @throws TimeoutError in case a maximum duration has been specified and is exceeded.
|
|
418
353
|
*/
|
|
419
354
|
private async waitForExportResult(
|
|
420
355
|
sessionId: string,
|
|
421
356
|
body: ReqExport,
|
|
422
357
|
dto: ResComputeExports,
|
|
423
358
|
maxWaitMsec: number,
|
|
424
|
-
options?:
|
|
359
|
+
options?: RequestInit
|
|
425
360
|
): Promise<ResComputeExports> {
|
|
426
361
|
let delay = this.getMaxExportDelay(body, dto);
|
|
427
362
|
const startMsec = Date.now();
|
|
@@ -441,9 +376,7 @@ export class UtilsApi extends BaseAPI {
|
|
|
441
376
|
await sleep(delay);
|
|
442
377
|
|
|
443
378
|
// Send cache request
|
|
444
|
-
dto = (
|
|
445
|
-
await new ExportApi(this.configuration).getCachedExports(sessionId, body, options)
|
|
446
|
-
).data;
|
|
379
|
+
dto = await new ExportApi(this.configuration).getCachedExports(sessionId, body, options);
|
|
447
380
|
delay = this.getMaxExportDelay(body, dto);
|
|
448
381
|
}
|
|
449
382
|
|
|
@@ -452,7 +385,7 @@ export class UtilsApi extends BaseAPI {
|
|
|
452
385
|
|
|
453
386
|
/**
|
|
454
387
|
* Get the maximum delay that was reported for output versions.
|
|
455
|
-
* @param
|
|
388
|
+
* @param dto The DTO resulting from a customization request.
|
|
456
389
|
* @returns maximum delay, -1 in case no delay was reported
|
|
457
390
|
*/
|
|
458
391
|
private getMaxOutputDelay(dto: ResComputeOutputs | ResGetCachedOutputs): number {
|
|
@@ -465,7 +398,7 @@ export class UtilsApi extends BaseAPI {
|
|
|
465
398
|
/**
|
|
466
399
|
* Get the maximum delay that was reported for the exports. If outputs have been reported as
|
|
467
400
|
* well, their delay time is included too.
|
|
468
|
-
* @param
|
|
401
|
+
* @param dto The DTO resulting from an export request.
|
|
469
402
|
* @returns delay, -1 in case no delay was reported
|
|
470
403
|
*/
|
|
471
404
|
private getMaxExportDelay(
|
|
@@ -487,77 +420,121 @@ export class UtilsApi extends BaseAPI {
|
|
|
487
420
|
}
|
|
488
421
|
|
|
489
422
|
/**
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
* @param {*} data The data to send with the request.
|
|
495
|
-
* @param {*} [options={}] Optional http request options.
|
|
496
|
-
*/
|
|
497
|
-
private buildRequest(
|
|
423
|
+
* Replacement for `runtime.BaseAPI.request`.
|
|
424
|
+
* Needed to call `createFetchParameters`.
|
|
425
|
+
*/
|
|
426
|
+
private async fetchRequest(
|
|
498
427
|
method: string,
|
|
499
428
|
url: string,
|
|
500
|
-
data:
|
|
501
|
-
options:
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
// in the serialization process.
|
|
512
|
-
const configuration = this.configuration ?? new Configuration();
|
|
513
|
-
reqOptions.data = this.serializeDataSafely(data, reqOptions, configuration);
|
|
514
|
-
}
|
|
429
|
+
data: unknown,
|
|
430
|
+
options: RequestInit = {},
|
|
431
|
+
disableHeaders: DisableHeaders = []
|
|
432
|
+
): Promise<Response> {
|
|
433
|
+
const { url: requestUrl, init } = await this.createFetchParameters(
|
|
434
|
+
method,
|
|
435
|
+
url,
|
|
436
|
+
data,
|
|
437
|
+
options,
|
|
438
|
+
disableHeaders
|
|
439
|
+
);
|
|
515
440
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
this.configuration && url.startsWith('http')
|
|
519
|
-
? new Configuration({ ...this.configuration, basePath: undefined })
|
|
520
|
-
: this.configuration;
|
|
441
|
+
const response = await this.fetchApi(requestUrl, init);
|
|
442
|
+
if (response.ok) return response;
|
|
521
443
|
|
|
522
|
-
|
|
523
|
-
return createRequestFunction(axiosArgs, this.axios, basePath, configuration).bind(
|
|
524
|
-
this.axios
|
|
525
|
-
);
|
|
526
|
-
};
|
|
444
|
+
throw new ClientResponseError(response, 'Response returned an error code');
|
|
527
445
|
}
|
|
528
446
|
|
|
529
447
|
/**
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
* this case, the Bearer token from the API configuration will be used.
|
|
536
|
-
* @param url The URL to send the request to.
|
|
537
|
-
* @param options The Axios request options.
|
|
538
|
-
* @returns The merged Axios request options.
|
|
539
|
-
*/
|
|
540
|
-
private async buildRequestOptions(
|
|
448
|
+
* Replacement for `runtime.BaseAPI.createFetchParams`.
|
|
449
|
+
* Needed to allow dynamic basePath handling and proper header manipulation.
|
|
450
|
+
*/
|
|
451
|
+
private async createFetchParameters(
|
|
452
|
+
method: string,
|
|
541
453
|
url: string,
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
if (
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
454
|
+
data: unknown,
|
|
455
|
+
options: RequestInit,
|
|
456
|
+
disableHeaders: DisableHeaders
|
|
457
|
+
): Promise<{ url: string; init: RequestInit }> {
|
|
458
|
+
const configuration = this.configuration ?? new Configuration();
|
|
459
|
+
|
|
460
|
+
// Add authorization if applicable.
|
|
461
|
+
const authHeaders: Record<string, string> = {};
|
|
462
|
+
if (
|
|
463
|
+
this.isTargetingInternalOrNoCdnServer(url) &&
|
|
464
|
+
this.configuration &&
|
|
465
|
+
this.configuration.accessToken
|
|
466
|
+
) {
|
|
467
|
+
const token = this.configuration.accessToken;
|
|
468
|
+
const tokenString = await token("JwtAuth", []);
|
|
469
|
+
|
|
470
|
+
if (tokenString) authHeaders["Authorization"] = `Bearer ${tokenString}`;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
const headers = new Headers(configuration.headers);
|
|
474
|
+
for (const source of [
|
|
475
|
+
authHeaders,
|
|
476
|
+
options.headers,
|
|
477
|
+
]) {
|
|
478
|
+
if (!source) continue;
|
|
479
|
+
new Headers(source).forEach((value, name) => headers.set(name, value));
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// Remove all disabled headers.
|
|
483
|
+
disableHeaders.forEach(header => headers.delete(header));
|
|
484
|
+
|
|
485
|
+
const init: RequestInit = {
|
|
486
|
+
...options,
|
|
487
|
+
method,
|
|
488
|
+
headers,
|
|
489
|
+
body: this.serializeDataForFetch(data, headers),
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
return {
|
|
493
|
+
url: this.createFetchUrl(url),
|
|
494
|
+
init
|
|
558
495
|
};
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** Prepends the base-path to `url` when the URL is relative. */
|
|
499
|
+
private createFetchUrl(url: string): string {
|
|
500
|
+
if (url.startsWith("http")) return url;
|
|
501
|
+
|
|
502
|
+
const basePath = this.configuration.basePath.replace(/\/+$/, "");
|
|
503
|
+
const path = url.replace(/^\/+/, "");
|
|
559
504
|
|
|
560
|
-
return
|
|
505
|
+
return `${basePath}/${path}`;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/** Passes `BodyInit` types through, stringifies JSON bodies and throws for invalid types. */
|
|
509
|
+
private serializeDataForFetch(data: unknown, headers: Headers): BodyInit | undefined {
|
|
510
|
+
if (data === undefined || data === null) return undefined;
|
|
511
|
+
|
|
512
|
+
if (
|
|
513
|
+
typeof data === 'string' ||
|
|
514
|
+
data instanceof ArrayBuffer ||
|
|
515
|
+
ArrayBuffer.isView(data) ||
|
|
516
|
+
(typeof Blob !== 'undefined' && data instanceof Blob) ||
|
|
517
|
+
(typeof FormData !== 'undefined' && data instanceof FormData) ||
|
|
518
|
+
(typeof URLSearchParams !== 'undefined' && data instanceof URLSearchParams) ||
|
|
519
|
+
(typeof ReadableStream !== 'undefined' && data instanceof ReadableStream)
|
|
520
|
+
) {
|
|
521
|
+
return data as BodyInit;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
if (!this.isJsonMime(headers.get('content-type') ?? '')) {
|
|
525
|
+
throw new TypeError(
|
|
526
|
+
'Request body must be a Fetch BodyInit value or use a JSON Content-Type.'
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
const body = JSON.stringify(data);
|
|
531
|
+
|
|
532
|
+
// JSON.stringify(undefined), functions, and symbols returns undefined.
|
|
533
|
+
if (body === undefined) {
|
|
534
|
+
throw new TypeError('Request body cannot be serialized as JSON.');
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
return body;
|
|
561
538
|
}
|
|
562
539
|
|
|
563
540
|
/**
|
|
@@ -578,57 +555,27 @@ export class UtilsApi extends BaseAPI {
|
|
|
578
555
|
}
|
|
579
556
|
}
|
|
580
557
|
|
|
581
|
-
/**
|
|
582
|
-
* A wrapper around the auto-generated `serializeDataIfNeeded` that safely serializes data for
|
|
583
|
-
* Axios. The idea of the base function is to stringify objects for application-json requests.
|
|
584
|
-
* However, this does not work on all data types. Thus, this wrapper passes through all data
|
|
585
|
-
* types that can be handled natively by Axios, and only calls the base function for the rest.
|
|
586
|
-
* @param value The data to serialize.
|
|
587
|
-
* @param requestOptions The request options.
|
|
588
|
-
* @param configuration The API configuration.
|
|
589
|
-
* @returns The serialized data.
|
|
590
|
-
*/
|
|
591
|
-
private serializeDataSafely(
|
|
592
|
-
value: any,
|
|
593
|
-
requestOptions: any,
|
|
594
|
-
configuration?: Configuration
|
|
595
|
-
): any {
|
|
596
|
-
// Helper: detect Node.js stream
|
|
597
|
-
function isStream(val: any): boolean {
|
|
598
|
-
return val !== null && typeof val === 'object' && typeof val.pipe === 'function';
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
// Pass through raw binary types that Axios can handle
|
|
602
|
-
if (
|
|
603
|
-
value instanceof ArrayBuffer ||
|
|
604
|
-
ArrayBuffer.isView(value) || // TypedArray (Uint8Array, Int16Array, etc.) and DataView
|
|
605
|
-
isStream(value) ||
|
|
606
|
-
(typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) ||
|
|
607
|
-
(typeof Blob !== 'undefined' && value instanceof Blob) ||
|
|
608
|
-
(typeof File !== 'undefined' && value instanceof File) ||
|
|
609
|
-
(typeof FormData !== 'undefined' && value instanceof FormData) ||
|
|
610
|
-
(typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams)
|
|
611
|
-
) {
|
|
612
|
-
return value;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
// Fallback to the generated serializer
|
|
616
|
-
return serializeDataIfNeeded(value, requestOptions, configuration);
|
|
617
|
-
}
|
|
618
|
-
|
|
619
558
|
/** Disable the Authorization header for ShapeDiver URIs if not explicitly set. */
|
|
620
|
-
private disableAuthHeaderForShapeDiverUris(
|
|
559
|
+
private disableAuthHeaderForShapeDiverUris(
|
|
560
|
+
url: string,
|
|
561
|
+
options: RequestInit,
|
|
562
|
+
disableHeaders: DisableHeaders,
|
|
563
|
+
): void {
|
|
564
|
+
const headers = new Headers(options.headers);
|
|
565
|
+
|
|
621
566
|
// When an authorization header is set, it will override anything that is set later
|
|
622
|
-
if (
|
|
567
|
+
if (headers.has('Authorization')) return;
|
|
568
|
+
|
|
569
|
+
const fetchUrl = this.createFetchUrl(url);
|
|
623
570
|
|
|
624
571
|
let targetUrl: URL;
|
|
625
572
|
try {
|
|
626
|
-
targetUrl = new URL(
|
|
573
|
+
targetUrl = new URL(fetchUrl);
|
|
627
574
|
} catch {
|
|
628
575
|
return;
|
|
629
576
|
}
|
|
630
577
|
|
|
631
|
-
if (directDownloadUri.test(targetUrl.origin) || cdnAssetUri.test(
|
|
632
|
-
|
|
578
|
+
if (directDownloadUri.test(targetUrl.origin) || cdnAssetUri.test(targetUrl.pathname))
|
|
579
|
+
disableHeaders.push('Authorization');
|
|
633
580
|
}
|
|
634
581
|
}
|