@icreate/ics-chromely-js-sdk
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -93,3 +93,3 @@ /*! ***************************************************************************** | ||
request: new InterceptorManage(), | ||
response: new InterceptorManage(), | ||
response: new InterceptorManage() | ||
}; | ||
@@ -109,11 +109,37 @@ this.interceptors.response.use(function (response) { | ||
IcsChromelyClient.prototype.command = function (opts) { | ||
var link = document.createElement('a'); | ||
var params = []; | ||
for (var key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
} | ||
link.href = "" + this._baseCommandUrl + opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var params, key; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!!window.IMedxAsync) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, CefSharp.BindObjectAsync('IMedxAsync')]; | ||
case 1: | ||
_a.sent(); | ||
_a.label = 2; | ||
case 2: | ||
params = []; | ||
for (key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
} | ||
return [4 /*yield*/, IMedxAsync.command("" + opts.url + (params.length > 0 ? "?" + params.join('&') : '')) | ||
// let link = document.createElement('a') | ||
// link.target = '_blank' | ||
// let params: Array<string> = [] | ||
// for (let key in opts.data) { | ||
// params.push(key + '=' + opts.data[key]) | ||
// } | ||
// link.href = `${this._baseCommandUrl}${opts.url}${ | ||
// params.length > 0 ? `?${params.join('&')}` : '' | ||
// }` | ||
// document.body.appendChild(link) | ||
// link.click() | ||
// document.body.removeChild(link) | ||
]; | ||
case 3: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
@@ -176,3 +202,3 @@ IcsChromelyClient.prototype.function = function (opts) { | ||
error = { | ||
message: body, | ||
message: body | ||
}; | ||
@@ -187,4 +213,4 @@ } | ||
}, | ||
rejected: undefined, | ||
}, | ||
rejected: undefined | ||
} | ||
]; | ||
@@ -191,0 +217,0 @@ // 拦截器加入执行链 |
@@ -99,3 +99,3 @@ (function (global, factory) { | ||
request: new InterceptorManage(), | ||
response: new InterceptorManage(), | ||
response: new InterceptorManage() | ||
}; | ||
@@ -115,11 +115,37 @@ this.interceptors.response.use(function (response) { | ||
IcsChromelyClient.prototype.command = function (opts) { | ||
var link = document.createElement('a'); | ||
var params = []; | ||
for (var key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
} | ||
link.href = "" + this._baseCommandUrl + opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var params, key; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!!window.IMedxAsync) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, CefSharp.BindObjectAsync('IMedxAsync')]; | ||
case 1: | ||
_a.sent(); | ||
_a.label = 2; | ||
case 2: | ||
params = []; | ||
for (key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
} | ||
return [4 /*yield*/, IMedxAsync.command("" + opts.url + (params.length > 0 ? "?" + params.join('&') : '')) | ||
// let link = document.createElement('a') | ||
// link.target = '_blank' | ||
// let params: Array<string> = [] | ||
// for (let key in opts.data) { | ||
// params.push(key + '=' + opts.data[key]) | ||
// } | ||
// link.href = `${this._baseCommandUrl}${opts.url}${ | ||
// params.length > 0 ? `?${params.join('&')}` : '' | ||
// }` | ||
// document.body.appendChild(link) | ||
// link.click() | ||
// document.body.removeChild(link) | ||
]; | ||
case 3: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
@@ -182,3 +208,3 @@ IcsChromelyClient.prototype.function = function (opts) { | ||
error = { | ||
message: body, | ||
message: body | ||
}; | ||
@@ -193,4 +219,4 @@ } | ||
}, | ||
rejected: undefined, | ||
}, | ||
rejected: undefined | ||
} | ||
]; | ||
@@ -197,0 +223,0 @@ // 拦截器加入执行链 |
@@ -68,3 +68,3 @@ "use strict"; | ||
request: new Interceptor_manage_1.default(), | ||
response: new Interceptor_manage_1.default(), | ||
response: new Interceptor_manage_1.default() | ||
}; | ||
@@ -84,11 +84,37 @@ this.interceptors.response.use(function (response) { | ||
IcsChromelyClient.prototype.command = function (opts) { | ||
var link = document.createElement('a'); | ||
var params = []; | ||
for (var key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
} | ||
link.href = "" + this._baseCommandUrl + opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var params, key; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!!window.IMedxAsync) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, CefSharp.BindObjectAsync('IMedxAsync')]; | ||
case 1: | ||
_a.sent(); | ||
_a.label = 2; | ||
case 2: | ||
params = []; | ||
for (key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
} | ||
return [4 /*yield*/, IMedxAsync.command("" + opts.url + (params.length > 0 ? "?" + params.join('&') : '')) | ||
// let link = document.createElement('a') | ||
// link.target = '_blank' | ||
// let params: Array<string> = [] | ||
// for (let key in opts.data) { | ||
// params.push(key + '=' + opts.data[key]) | ||
// } | ||
// link.href = `${this._baseCommandUrl}${opts.url}${ | ||
// params.length > 0 ? `?${params.join('&')}` : '' | ||
// }` | ||
// document.body.appendChild(link) | ||
// link.click() | ||
// document.body.removeChild(link) | ||
]; | ||
case 3: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
@@ -151,3 +177,3 @@ IcsChromelyClient.prototype.function = function (opts) { | ||
error = { | ||
message: body, | ||
message: body | ||
}; | ||
@@ -162,4 +188,4 @@ } | ||
}, | ||
rejected: undefined, | ||
}, | ||
rejected: undefined | ||
} | ||
]; | ||
@@ -166,0 +192,0 @@ // 拦截器加入执行链 |
@@ -23,3 +23,3 @@ import InterceptorManager from './lib/Interceptor-manage'; | ||
data?: any; | ||
}): void; | ||
}): Promise<void>; | ||
function(opts: { | ||
@@ -26,0 +26,0 @@ url: string; |
{ | ||
"name": "@icreate/ics-chromely-js-sdk", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "", | ||
@@ -119,7 +119,3 @@ "keywords": [], | ||
"typescript": "^3.0.3" | ||
}, | ||
"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
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
75204
0
790
- Removedcross-fetch@^3.1.5
- Removed@icreate/ics-chromely-js-sdk@0.0.5(transitive)
- Removedcross-fetch@3.2.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)