@icreate/ics-chromely-js-sdk
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -1,14 +0,14 @@ | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
@@ -28,7 +28,6 @@ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -115,3 +114,3 @@ }); | ||
} | ||
link.href = "".concat(this._baseCommandUrl).concat(opts.url).concat(params.length > 0 ? "?".concat(params.join('&')) : ''); | ||
link.href = "" + this._baseCommandUrl + opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
document.body.appendChild(link); | ||
@@ -131,3 +130,8 @@ link.click(); | ||
var options = __assign(__assign({}, config), opts); | ||
options.headers['Content-Type'] = options.headers['Content-Type'] || 'application/json'; | ||
if (options.headers) { | ||
options.headers['Content-Type'] = options.headers['Content-Type'] || 'application/json'; | ||
} | ||
else { | ||
options.headers = { 'Content-Type': 'application/json' }; | ||
} | ||
if (((_a = opts === null || opts === void 0 ? void 0 : opts.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'GET' || ((_b = opts === null || opts === void 0 ? void 0 : opts.method) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === 'HEAD') { | ||
@@ -138,13 +142,14 @@ var params = []; | ||
} | ||
opts.url = opts.url + (params.length > 0 ? "?".concat(params.join('&')) : ''); | ||
opts.url = opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
} | ||
else { | ||
else if (options.headers['Content-Type'] === 'application/json') { | ||
options.body = JSON.stringify(opts.data); | ||
// options = { ...options, body: JSON.stringify(opts.data) } | ||
} | ||
else { | ||
options.body = opts.data; | ||
} | ||
var res = config | ||
.fetch("".concat(config._baseAjaxUrl).concat(opts.url), options) | ||
.fetch("" + config._baseAjaxUrl + opts.url, options) | ||
.then(function (res) { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, _b, error, body; | ||
var _c; | ||
var _a, _b, _c, error, body; | ||
return __generator(this, function (_d) { | ||
@@ -210,3 +215,3 @@ switch (_d.label) { | ||
export { icsChromelyRequest as default }; | ||
export default icsChromelyRequest; | ||
//# sourceMappingURL=ics-chromely-js-sdk.es5.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.icsChromelyJsSdk = factory()); | ||
})(this, (function () { 'use strict'; | ||
(global.icsChromelyJsSdk = factory()); | ||
}(this, (function () { 'use strict'; | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
@@ -34,7 +34,6 @@ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -121,3 +120,3 @@ }); | ||
} | ||
link.href = "".concat(this._baseCommandUrl).concat(opts.url).concat(params.length > 0 ? "?".concat(params.join('&')) : ''); | ||
link.href = "" + this._baseCommandUrl + opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
document.body.appendChild(link); | ||
@@ -137,3 +136,8 @@ link.click(); | ||
var options = __assign(__assign({}, config), opts); | ||
options.headers['Content-Type'] = options.headers['Content-Type'] || 'application/json'; | ||
if (options.headers) { | ||
options.headers['Content-Type'] = options.headers['Content-Type'] || 'application/json'; | ||
} | ||
else { | ||
options.headers = { 'Content-Type': 'application/json' }; | ||
} | ||
if (((_a = opts === null || opts === void 0 ? void 0 : opts.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'GET' || ((_b = opts === null || opts === void 0 ? void 0 : opts.method) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === 'HEAD') { | ||
@@ -144,13 +148,14 @@ var params = []; | ||
} | ||
opts.url = opts.url + (params.length > 0 ? "?".concat(params.join('&')) : ''); | ||
opts.url = opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
} | ||
else { | ||
else if (options.headers['Content-Type'] === 'application/json') { | ||
options.body = JSON.stringify(opts.data); | ||
// options = { ...options, body: JSON.stringify(opts.data) } | ||
} | ||
else { | ||
options.body = opts.data; | ||
} | ||
var res = config | ||
.fetch("".concat(config._baseAjaxUrl).concat(opts.url), options) | ||
.fetch("" + config._baseAjaxUrl + opts.url, options) | ||
.then(function (res) { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, _b, error, body; | ||
var _c; | ||
var _a, _b, _c, error, body; | ||
return __generator(this, function (_d) { | ||
@@ -218,3 +223,3 @@ switch (_d.label) { | ||
})); | ||
}))); | ||
//# sourceMappingURL=ics-chromely-js-sdk.umd.js.map |
@@ -54,3 +54,3 @@ "use strict"; | ||
* @LastEditors: 陶慧灵 | ||
* @LastEditTime: 2022-12-11 01:15:53 | ||
* @LastEditTime: 2022-12-13 10:32:07 | ||
* @Description: | ||
@@ -89,3 +89,3 @@ * @FilePath: \ics-chromely\src\ics-chromely-js-sdk.ts | ||
} | ||
link.href = "".concat(this._baseCommandUrl).concat(opts.url).concat(params.length > 0 ? "?".concat(params.join('&')) : ''); | ||
link.href = "" + this._baseCommandUrl + opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
document.body.appendChild(link); | ||
@@ -105,3 +105,8 @@ link.click(); | ||
var options = __assign(__assign({}, config), opts); | ||
options.headers['Content-Type'] = options.headers['Content-Type'] || 'application/json'; | ||
if (options.headers) { | ||
options.headers['Content-Type'] = options.headers['Content-Type'] || 'application/json'; | ||
} | ||
else { | ||
options.headers = { 'Content-Type': 'application/json' }; | ||
} | ||
if (((_a = opts === null || opts === void 0 ? void 0 : opts.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'GET' || ((_b = opts === null || opts === void 0 ? void 0 : opts.method) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === 'HEAD') { | ||
@@ -112,13 +117,14 @@ var params = []; | ||
} | ||
opts.url = opts.url + (params.length > 0 ? "?".concat(params.join('&')) : ''); | ||
opts.url = opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
} | ||
else { | ||
else if (options.headers['Content-Type'] === 'application/json') { | ||
options.body = JSON.stringify(opts.data); | ||
// options = { ...options, body: JSON.stringify(opts.data) } | ||
} | ||
else { | ||
options.body = opts.data; | ||
} | ||
var res = config | ||
.fetch("".concat(config._baseAjaxUrl).concat(opts.url), options) | ||
.fetch("" + config._baseAjaxUrl + opts.url, options) | ||
.then(function (res) { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, _b, error, body; | ||
var _c; | ||
var _a, _b, _c, error, body; | ||
return __generator(this, function (_d) { | ||
@@ -125,0 +131,0 @@ switch (_d.label) { |
@@ -28,3 +28,3 @@ import InterceptorManager from './lib/Interceptor-manage'; | ||
data?: any; | ||
headers: { | ||
headers?: { | ||
[key: string]: string; | ||
@@ -31,0 +31,0 @@ }; |
{ | ||
"name": "@icreate/ics-chromely-js-sdk", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "", | ||
@@ -121,4 +121,5 @@ "keywords": [], | ||
"dependencies": { | ||
"@icreate/ics-chromely-js-sdk": "^0.0.5-beta.1", | ||
"cross-fetch": "^3.1.5" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
712
69730
2
1
+ Added@icreate/ics-chromely-js-sdk@0.0.5(transitive)