@c8y/client 1018.376.0 → 1018.378.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/NOTICES +4 -4
- package/lib/bundles/client.umd.js +30 -27
- package/lib/bundles/client.umd.js.map +1 -1
- package/lib/bundles/client.umd.min.js +1 -1
- package/lib/bundles/client.umd.min.js.map +1 -1
- package/lib/cjs/src/application/ApplicationBinaryService.js +12 -13
- package/lib/cjs/src/application/ApplicationBinaryService.js.map +1 -1
- package/lib/cjs/src/core/FetchClient.js +6 -1
- package/lib/cjs/src/core/FetchClient.js.map +1 -1
- package/lib/cjs/src/device-registration/DeviceRegistrationBulkService.js +2 -6
- package/lib/cjs/src/device-registration/DeviceRegistrationBulkService.js.map +1 -1
- package/lib/cjs/src/inventory/InventoryBinaryService.js +10 -7
- package/lib/cjs/src/inventory/InventoryBinaryService.js.map +1 -1
- package/lib/esm2015/src/application/ApplicationBinaryService.js +12 -13
- package/lib/esm2015/src/application/ApplicationBinaryService.js.map +1 -1
- package/lib/esm2015/src/core/FetchClient.js +6 -1
- package/lib/esm2015/src/core/FetchClient.js.map +1 -1
- package/lib/esm2015/src/device-registration/DeviceRegistrationBulkService.js +2 -6
- package/lib/esm2015/src/device-registration/DeviceRegistrationBulkService.js.map +1 -1
- package/lib/esm2015/src/inventory/InventoryBinaryService.js +10 -7
- package/lib/esm2015/src/inventory/InventoryBinaryService.js.map +1 -1
- package/lib/src/core/FetchClient.d.ts +1 -0
- package/lib/src/core/IFetchOptions.d.ts +3 -1
- package/package.json +2 -4
package/NOTICES
CHANGED
|
@@ -4299,7 +4299,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
4299
4299
|
|
|
4300
4300
|
-----
|
|
4301
4301
|
|
|
4302
|
-
The following software may be included in this product: ansi-escapes, ansi-regex, ansi-styles, array-find-index,
|
|
4302
|
+
The following software may be included in this product: ansi-escapes, ansi-regex, ansi-styles, array-find-index, chalk, cli-cursor, code-point-at, decamelize, escape-string-regexp, figures, get-stream, has-ansi, import-lazy, is-fullwidth-code-point, lowercase-keys, number-is-nan, object-assign, onetime, os-homedir, os-tmpdir, p-defer, p-finally, path-is-absolute, path-key, pify, restore-cursor, shebang-regex, string-width, strip-ansi, strip-bom, strip-json-comments, supports-color. A copy of the source code may be downloaded from https://github.com/sindresorhus/ansi-escapes.git (ansi-escapes), https://github.com/chalk/ansi-regex.git (ansi-regex), https://github.com/chalk/ansi-styles.git (ansi-styles), https://github.com/sindresorhus/array-find-index.git (array-find-index), https://github.com/chalk/chalk.git (chalk), https://github.com/sindresorhus/cli-cursor.git (cli-cursor), https://github.com/sindresorhus/code-point-at.git (code-point-at), https://github.com/sindresorhus/decamelize.git (decamelize), https://github.com/sindresorhus/escape-string-regexp.git (escape-string-regexp), https://github.com/sindresorhus/figures.git (figures), https://github.com/sindresorhus/get-stream.git (get-stream), https://github.com/sindresorhus/has-ansi.git (has-ansi), https://github.com/sindresorhus/import-lazy.git (import-lazy), https://github.com/sindresorhus/is-fullwidth-code-point.git (is-fullwidth-code-point), https://github.com/sindresorhus/lowercase-keys.git (lowercase-keys), https://github.com/sindresorhus/number-is-nan.git (number-is-nan), https://github.com/sindresorhus/object-assign.git (object-assign), https://github.com/sindresorhus/onetime.git (onetime), https://github.com/sindresorhus/os-homedir.git (os-homedir), https://github.com/sindresorhus/os-tmpdir.git (os-tmpdir), https://github.com/sindresorhus/p-defer.git (p-defer), https://github.com/sindresorhus/p-finally.git (p-finally), https://github.com/sindresorhus/path-is-absolute.git (path-is-absolute), https://github.com/sindresorhus/path-key.git (path-key), https://github.com/sindresorhus/pify.git (pify), https://github.com/sindresorhus/restore-cursor.git (restore-cursor), https://github.com/sindresorhus/shebang-regex.git (shebang-regex), https://github.com/sindresorhus/string-width.git (string-width), https://github.com/chalk/strip-ansi.git (strip-ansi), https://github.com/sindresorhus/strip-bom.git (strip-bom), https://github.com/sindresorhus/strip-json-comments.git (strip-json-comments), https://github.com/chalk/supports-color.git (supports-color). This software contains the following license and notice below:
|
|
4303
4303
|
|
|
4304
4304
|
The MIT License (MIT)
|
|
4305
4305
|
|
|
@@ -8456,7 +8456,7 @@ THE SOFTWARE.
|
|
|
8456
8456
|
|
|
8457
8457
|
-----
|
|
8458
8458
|
|
|
8459
|
-
The following software may be included in this product: cometd, cometd-nodejs-client, fast-text-encoding
|
|
8459
|
+
The following software may be included in this product: cometd, cometd-nodejs-client, fast-text-encoding. A copy of the source code may be downloaded from https://github.com/cometd/cometd.git (cometd), https://github.com/cometd/cometd-nodejs-client.git (cometd-nodejs-client), https://github.com/samthor/fast-text-encoding.git (fast-text-encoding). This software contains the following license and notice below:
|
|
8460
8460
|
|
|
8461
8461
|
Apache License
|
|
8462
8462
|
Version 2.0, January 2004
|
|
@@ -9354,7 +9354,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
9354
9354
|
|
|
9355
9355
|
-----
|
|
9356
9356
|
|
|
9357
|
-
The following software may be included in this product: cosmiconfig. A copy of the source code may be downloaded from git+https://github.com/
|
|
9357
|
+
The following software may be included in this product: cosmiconfig. A copy of the source code may be downloaded from git+https://github.com/davidtheclark/cosmiconfig.git. This software contains the following license and notice below:
|
|
9358
9358
|
|
|
9359
9359
|
The MIT License (MIT)
|
|
9360
9360
|
|
|
@@ -9380,7 +9380,7 @@ SOFTWARE.
|
|
|
9380
9380
|
|
|
9381
9381
|
-----
|
|
9382
9382
|
|
|
9383
|
-
The following software may be included in this product: create-jest-runner. A copy of the source code may be downloaded from https://github.com/
|
|
9383
|
+
The following software may be included in this product: create-jest-runner. A copy of the source code may be downloaded from https://github.com/rogeliog/create-jest-runner.git. This software contains the following license and notice below:
|
|
9384
9384
|
|
|
9385
9385
|
MIT License
|
|
9386
9386
|
|
|
@@ -4338,7 +4338,8 @@
|
|
|
4338
4338
|
}
|
|
4339
4339
|
const fullUrl = this.getUrl(url, init);
|
|
4340
4340
|
const options = this.getFetchOptions(init);
|
|
4341
|
-
|
|
4341
|
+
const optionsWithAdjustedBody = this.adjustOptionsForFormData(options);
|
|
4342
|
+
return fetchFn(fullUrl, optionsWithAdjustedBody);
|
|
4342
4343
|
});
|
|
4343
4344
|
}
|
|
4344
4345
|
getUrl(url = '', options) {
|
|
@@ -4387,6 +4388,10 @@
|
|
|
4387
4388
|
throw Error('Your environment does not support relative URLs. Please provide a base URL.');
|
|
4388
4389
|
}
|
|
4389
4390
|
}
|
|
4391
|
+
adjustOptionsForFormData(options) {
|
|
4392
|
+
const newOptions = Object.assign(options, { body: options.body });
|
|
4393
|
+
return newOptions;
|
|
4394
|
+
}
|
|
4390
4395
|
}
|
|
4391
4396
|
|
|
4392
4397
|
var error = function (message) {
|
|
@@ -5192,13 +5197,9 @@
|
|
|
5192
5197
|
}
|
|
5193
5198
|
body.append('file', file, fileName);
|
|
5194
5199
|
body.append('object', JSON.stringify(managedObject));
|
|
5195
|
-
|
|
5196
|
-
if (typeof body.getHeaders === 'function') {
|
|
5197
|
-
bodyHeaders = body.getHeaders();
|
|
5198
|
-
}
|
|
5199
|
-
const headers = Object.assign({
|
|
5200
|
+
const headers = {
|
|
5200
5201
|
accept: 'application/json'
|
|
5201
|
-
}
|
|
5202
|
+
};
|
|
5202
5203
|
const res = yield this.fetch(url, { method, body, headers });
|
|
5203
5204
|
const data = yield res.json();
|
|
5204
5205
|
return { res, data };
|
|
@@ -5277,7 +5278,14 @@
|
|
|
5277
5278
|
}
|
|
5278
5279
|
}
|
|
5279
5280
|
xhr.upload.addEventListener('progress', onProgress);
|
|
5280
|
-
|
|
5281
|
+
let xhrBody;
|
|
5282
|
+
if (typeof body.getBuffer === 'function') {
|
|
5283
|
+
xhrBody = body.getBuffer();
|
|
5284
|
+
}
|
|
5285
|
+
else {
|
|
5286
|
+
xhrBody = body;
|
|
5287
|
+
}
|
|
5288
|
+
xhr.send(xhrBody);
|
|
5281
5289
|
return xhr;
|
|
5282
5290
|
}
|
|
5283
5291
|
getXMLHttpResponse(xhr) {
|
|
@@ -7921,7 +7929,14 @@
|
|
|
7921
7929
|
}
|
|
7922
7930
|
}
|
|
7923
7931
|
xhr.upload.addEventListener('progress', onProgress);
|
|
7924
|
-
|
|
7932
|
+
let xhrBody;
|
|
7933
|
+
if (typeof body.getBuffer === 'function') {
|
|
7934
|
+
xhrBody = body.getBuffer();
|
|
7935
|
+
}
|
|
7936
|
+
else {
|
|
7937
|
+
xhrBody = body;
|
|
7938
|
+
}
|
|
7939
|
+
xhr.send(xhrBody);
|
|
7925
7940
|
return xhr;
|
|
7926
7941
|
}
|
|
7927
7942
|
getXMLHttpResponse(xhr) {
|
|
@@ -7965,13 +7980,9 @@
|
|
|
7965
7980
|
const body = new browser();
|
|
7966
7981
|
const bufferOrStream = pluginFile instanceof ArrayBuffer ? Buffer.from(pluginFile) : pluginFile;
|
|
7967
7982
|
body.append('file', bufferOrStream);
|
|
7968
|
-
|
|
7969
|
-
if (typeof body.getHeaders === 'function') {
|
|
7970
|
-
bodyHeaders = body.getHeaders();
|
|
7971
|
-
}
|
|
7972
|
-
const headers = Object.assign({
|
|
7983
|
+
const headers = {
|
|
7973
7984
|
accept: 'application/json'
|
|
7974
|
-
}
|
|
7985
|
+
};
|
|
7975
7986
|
const res = yield this.fetch(url, { method, body, headers });
|
|
7976
7987
|
const data = yield res.json();
|
|
7977
7988
|
return { res, data };
|
|
@@ -7996,13 +8007,9 @@
|
|
|
7996
8007
|
const bufferOrStream = file.contents instanceof ArrayBuffer ? Buffer.from(file.contents) : file.contents;
|
|
7997
8008
|
body.append(file.path, bufferOrStream);
|
|
7998
8009
|
});
|
|
7999
|
-
|
|
8000
|
-
if (typeof body.getHeaders === 'function') {
|
|
8001
|
-
bodyHeaders = body.getHeaders();
|
|
8002
|
-
}
|
|
8003
|
-
const headers = Object.assign({
|
|
8010
|
+
const headers = {
|
|
8004
8011
|
accept: 'application/json'
|
|
8005
|
-
}
|
|
8012
|
+
};
|
|
8006
8013
|
const res = yield this.fetch(url, { method, body, headers });
|
|
8007
8014
|
const data = yield res.json();
|
|
8008
8015
|
return { res, data };
|
|
@@ -9843,13 +9850,9 @@
|
|
|
9843
9850
|
}
|
|
9844
9851
|
}
|
|
9845
9852
|
body.append('file', csv, fileName);
|
|
9846
|
-
|
|
9847
|
-
if (typeof body.getHeaders === 'function') {
|
|
9848
|
-
bodyHeaders = body.getHeaders();
|
|
9849
|
-
}
|
|
9850
|
-
const headers = Object.assign({
|
|
9853
|
+
const headers = {
|
|
9851
9854
|
accept: 'application/json'
|
|
9852
|
-
}
|
|
9855
|
+
};
|
|
9853
9856
|
const res = yield this.client.fetch(url, { method, body, headers });
|
|
9854
9857
|
const data = yield res.json();
|
|
9855
9858
|
return { res, data };
|