Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@imedx/ics-imedx-chromely-plugin-intf-platform

Package Overview
Dependencies
Maintainers
18
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@imedx/ics-imedx-chromely-plugin-intf-platform - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

207

dist/ics-imedx-chromely-plugin-intf-platform.es5.js
import icsChromelyRequest from '@icreate/ics-chromely-js-sdk';
import IMedx from '@imedx/ics-imedx-core';

@@ -143,2 +144,46 @@ /******************************************************************************

/**
* 获取接口信息
* @returns 配置选项记录
*/
IntfPlatform.GetInterfaceInfo = function (intfId) {
if (IntfPlatform.___intfInfo[intfId]) {
return Promise.resolve(IntfPlatform.___intfInfo[intfId]);
}
else {
return IMedx.request({
url: '/interface-platform/dict-interface/getInterfaceInfo',
method: 'post',
data: {
orgCode: this.orgId,
intfId: intfId
}
}).then(function (res) {
IntfPlatform.___intfInfo[intfId] = res.data;
return Promise.resolve(res.data);
});
}
};
/**
* 获取实现接口配置
* @returns 配置选项记录
*/
IntfPlatform.GetInterfaceConfig = function (intfId) {
if (IntfPlatform.___intfConfig[intfId]) {
return Promise.resolve(IntfPlatform.___intfConfig[intfId]);
}
else {
return IMedx.request({
url: '/interface-platform/interface-config/getInterfaceConfigMap',
method: 'post',
data: {
orgCode: this.orgId,
intfId: intfId
}
}).then(function (res) {
IntfPlatform.___intfConfig[intfId] = res.data;
return Promise.resolve(res.data);
});
}
};
/**
* 验证授权

@@ -185,67 +230,99 @@ * @param intfCode 接口编码

var _this = this;
// 校验接口是否有权限
var mode = IntfPlatform.GetInterfaceType(intfCode);
// switch (mode) {
// case InterfaceType.JS:
var chain = [
{
resolved: function (config) {
return IntfPlatform.authorization(intfCode);
// 获取核心接口配置选项
// 医保接口走独立配置的
if (intfCode === 'Interface.CHS.Core') {
var chain = [
{
resolved: function (config) {
return IntfPlatform.authorization(intfCode);
},
rejected: undefined
},
rejected: undefined
{
resolved: function (config) {
return _this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
},
rejected: undefined
}
];
var promise = Promise.resolve(__assign({}, this));
while (chain.length) {
var _a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected;
promise = promise.then(resolved, rejected);
}
];
if (mode === InterfaceType.JS) {
chain.push({
resolved: function (config) {
// 获取核心接口
var intfCoreInstance = IntfPlatform.getCoreInterface(intfCode);
// 判断核心接口是否存在
if (!intfCoreInstance) {
return Promise.reject({
code: 404,
message: "\u6838\u5FC3\u63A5\u53E3".concat(intfCode, "\u4E0D\u5B58\u5728\uFF01"),
data: null
});
}
else {
try {
return intfCoreInstance.business(code, param);
}
catch (error) {
var message = error.message;
return Promise.reject({
code: 404,
message: message || error,
data: null
});
}
}
},
rejected: undefined
});
// 返回接口结果
return promise;
}
else {
chain.push({
resolved: function (config) {
return _this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
},
rejected: undefined
return IntfPlatform.GetInterfaceInfo(intfCode).then(function (config) {
// 判断接口是否启用
if (config['enabled'] !== 1) {
return Promise.resolve(__assign({}, _this));
}
// 接口授权校验 前端 or 后端
// 校验接口是否有权限
var mode = config['type'] === 'JS' ? InterfaceType.JS : InterfaceType.DLL;
var chain = [
{
resolved: function (config) {
return IntfPlatform.authorization(intfCode);
},
rejected: undefined
}
];
if (mode === InterfaceType.JS) {
chain.push({
resolved: function (config) {
// 获取核心接口
var intfCoreInstance = IntfPlatform.getCoreInterface(intfCode);
// 判断核心接口是否存在
if (!intfCoreInstance) {
return Promise.reject({
code: 404,
message: "\u6838\u5FC3\u63A5\u53E3".concat(intfCode, "\u4E0D\u5B58\u5728\uFF01"),
data: null
});
}
else {
try {
return intfCoreInstance.business(code, param);
}
catch (error) {
var message = error.message;
return Promise.reject({
code: 404,
message: message || error,
data: null
});
}
}
},
rejected: undefined
});
}
else {
chain.push({
resolved: function (config) {
return _this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
},
rejected: undefined
});
}
// icsChromelyRequest.interceptors.response.interceptors.forEach(interceptor => {
// if (interceptor !== null) {
// chain.push(interceptor)
// }
// })
var promise = Promise.resolve(__assign({}, _this));
while (chain.length) {
var _a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected;
promise = promise.then(resolved, rejected);
}
// 返回接口结果
return promise;
// default:
// return this.OperateEx('Business', { intfCode, code, param: JSON.stringify(param) })
// }
});
}
// icsChromelyRequest.interceptors.response.interceptors.forEach(interceptor => {
// if (interceptor !== null) {
// chain.push(interceptor)
// }
// })
var promise = Promise.resolve(__assign({}, this));
while (chain.length) {
var _a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected;
promise = promise.then(resolved, rejected);
}
// 返回接口结果
return promise;
// default:
// return this.OperateEx('Business', { intfCode, code, param: JSON.stringify(param) })
// }
};

@@ -326,9 +403,17 @@ /**

/**
* 实现接口配置
* 实现接口配置(即将弃用)
*/
IntfPlatform.configs = {};
/**
* 核心接口配置
* 核心接口配置(即将弃用)
*/
IntfPlatform.coreConfigs = {};
/**
* 实现接口参数配置对象
*/
IntfPlatform.___intfConfig = {};
/**
* 核心接口参数配置对象
*/
IntfPlatform.___intfInfo = {};
return IntfPlatform;

@@ -335,0 +420,0 @@ }());

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@icreate/ics-chromely-js-sdk')) :
typeof define === 'function' && define.amd ? define(['exports', '@icreate/ics-chromely-js-sdk'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.IcsImedxChromelyPluginIntfPlatform = {}, global.IcsChromelyRequest));
})(this, (function (exports, icsChromelyRequest) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@icreate/ics-chromely-js-sdk'), require('@imedx/ics-imedx-core')) :
typeof define === 'function' && define.amd ? define(['exports', '@icreate/ics-chromely-js-sdk', '@imedx/ics-imedx-core'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.IcsImedxChromelyPluginIntfPlatform = {}, global.IcsChromelyRequest, global.IMedxCore));
})(this, (function (exports, icsChromelyRequest, IMedx) { 'use strict';

@@ -147,2 +147,46 @@ /******************************************************************************

/**
* 获取接口信息
* @returns 配置选项记录
*/
IntfPlatform.GetInterfaceInfo = function (intfId) {
if (IntfPlatform.___intfInfo[intfId]) {
return Promise.resolve(IntfPlatform.___intfInfo[intfId]);
}
else {
return IMedx.request({
url: '/interface-platform/dict-interface/getInterfaceInfo',
method: 'post',
data: {
orgCode: this.orgId,
intfId: intfId
}
}).then(function (res) {
IntfPlatform.___intfInfo[intfId] = res.data;
return Promise.resolve(res.data);
});
}
};
/**
* 获取实现接口配置
* @returns 配置选项记录
*/
IntfPlatform.GetInterfaceConfig = function (intfId) {
if (IntfPlatform.___intfConfig[intfId]) {
return Promise.resolve(IntfPlatform.___intfConfig[intfId]);
}
else {
return IMedx.request({
url: '/interface-platform/interface-config/getInterfaceConfigMap',
method: 'post',
data: {
orgCode: this.orgId,
intfId: intfId
}
}).then(function (res) {
IntfPlatform.___intfConfig[intfId] = res.data;
return Promise.resolve(res.data);
});
}
};
/**
* 验证授权

@@ -189,67 +233,99 @@ * @param intfCode 接口编码

var _this = this;
// 校验接口是否有权限
var mode = IntfPlatform.GetInterfaceType(intfCode);
// switch (mode) {
// case InterfaceType.JS:
var chain = [
{
resolved: function (config) {
return IntfPlatform.authorization(intfCode);
// 获取核心接口配置选项
// 医保接口走独立配置的
if (intfCode === 'Interface.CHS.Core') {
var chain = [
{
resolved: function (config) {
return IntfPlatform.authorization(intfCode);
},
rejected: undefined
},
rejected: undefined
{
resolved: function (config) {
return _this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
},
rejected: undefined
}
];
var promise = Promise.resolve(__assign({}, this));
while (chain.length) {
var _a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected;
promise = promise.then(resolved, rejected);
}
];
if (mode === exports.InterfaceType.JS) {
chain.push({
resolved: function (config) {
// 获取核心接口
var intfCoreInstance = IntfPlatform.getCoreInterface(intfCode);
// 判断核心接口是否存在
if (!intfCoreInstance) {
return Promise.reject({
code: 404,
message: "\u6838\u5FC3\u63A5\u53E3".concat(intfCode, "\u4E0D\u5B58\u5728\uFF01"),
data: null
});
}
else {
try {
return intfCoreInstance.business(code, param);
}
catch (error) {
var message = error.message;
return Promise.reject({
code: 404,
message: message || error,
data: null
});
}
}
},
rejected: undefined
});
// 返回接口结果
return promise;
}
else {
chain.push({
resolved: function (config) {
return _this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
},
rejected: undefined
return IntfPlatform.GetInterfaceInfo(intfCode).then(function (config) {
// 判断接口是否启用
if (config['enabled'] !== 1) {
return Promise.resolve(__assign({}, _this));
}
// 接口授权校验 前端 or 后端
// 校验接口是否有权限
var mode = config['type'] === 'JS' ? exports.InterfaceType.JS : exports.InterfaceType.DLL;
var chain = [
{
resolved: function (config) {
return IntfPlatform.authorization(intfCode);
},
rejected: undefined
}
];
if (mode === exports.InterfaceType.JS) {
chain.push({
resolved: function (config) {
// 获取核心接口
var intfCoreInstance = IntfPlatform.getCoreInterface(intfCode);
// 判断核心接口是否存在
if (!intfCoreInstance) {
return Promise.reject({
code: 404,
message: "\u6838\u5FC3\u63A5\u53E3".concat(intfCode, "\u4E0D\u5B58\u5728\uFF01"),
data: null
});
}
else {
try {
return intfCoreInstance.business(code, param);
}
catch (error) {
var message = error.message;
return Promise.reject({
code: 404,
message: message || error,
data: null
});
}
}
},
rejected: undefined
});
}
else {
chain.push({
resolved: function (config) {
return _this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
},
rejected: undefined
});
}
// icsChromelyRequest.interceptors.response.interceptors.forEach(interceptor => {
// if (interceptor !== null) {
// chain.push(interceptor)
// }
// })
var promise = Promise.resolve(__assign({}, _this));
while (chain.length) {
var _a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected;
promise = promise.then(resolved, rejected);
}
// 返回接口结果
return promise;
// default:
// return this.OperateEx('Business', { intfCode, code, param: JSON.stringify(param) })
// }
});
}
// icsChromelyRequest.interceptors.response.interceptors.forEach(interceptor => {
// if (interceptor !== null) {
// chain.push(interceptor)
// }
// })
var promise = Promise.resolve(__assign({}, this));
while (chain.length) {
var _a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected;
promise = promise.then(resolved, rejected);
}
// 返回接口结果
return promise;
// default:
// return this.OperateEx('Business', { intfCode, code, param: JSON.stringify(param) })
// }
};

@@ -330,9 +406,17 @@ /**

/**
* 实现接口配置
* 实现接口配置(即将弃用)
*/
IntfPlatform.configs = {};
/**
* 核心接口配置
* 核心接口配置(即将弃用)
*/
IntfPlatform.coreConfigs = {};
/**
* 实现接口参数配置对象
*/
IntfPlatform.___intfConfig = {};
/**
* 核心接口参数配置对象
*/
IntfPlatform.___intfInfo = {};
return IntfPlatform;

@@ -339,0 +423,0 @@ }());

@@ -16,2 +16,3 @@ "use strict";

var InterfaceCore_1 = require("./interfaces/InterfaceCore");
var ics_imedx_core_1 = require("@imedx/ics-imedx-core");
var IntfPlatform = /** @class */ (function () {

@@ -41,2 +42,46 @@ function IntfPlatform() {

/**
* 获取接口信息
* @returns 配置选项记录
*/
IntfPlatform.GetInterfaceInfo = function (intfId) {
if (IntfPlatform.___intfInfo[intfId]) {
return Promise.resolve(IntfPlatform.___intfInfo[intfId]);
}
else {
return ics_imedx_core_1.default.request({
url: '/interface-platform/dict-interface/getInterfaceInfo',
method: 'post',
data: {
orgCode: this.orgId,
intfId: intfId
}
}).then(function (res) {
IntfPlatform.___intfInfo[intfId] = res.data;
return Promise.resolve(res.data);
});
}
};
/**
* 获取实现接口配置
* @returns 配置选项记录
*/
IntfPlatform.GetInterfaceConfig = function (intfId) {
if (IntfPlatform.___intfConfig[intfId]) {
return Promise.resolve(IntfPlatform.___intfConfig[intfId]);
}
else {
return ics_imedx_core_1.default.request({
url: '/interface-platform/interface-config/getInterfaceConfigMap',
method: 'post',
data: {
orgCode: this.orgId,
intfId: intfId
}
}).then(function (res) {
IntfPlatform.___intfConfig[intfId] = res.data;
return Promise.resolve(res.data);
});
}
};
/**
* 验证授权

@@ -83,67 +128,99 @@ * @param intfCode 接口编码

var _this = this;
// 校验接口是否有权限
var mode = IntfPlatform.GetInterfaceType(intfCode);
// switch (mode) {
// case InterfaceType.JS:
var chain = [
{
resolved: function (config) {
return IntfPlatform.authorization(intfCode);
// 获取核心接口配置选项
// 医保接口走独立配置的
if (intfCode === 'Interface.CHS.Core') {
var chain = [
{
resolved: function (config) {
return IntfPlatform.authorization(intfCode);
},
rejected: undefined
},
rejected: undefined
{
resolved: function (config) {
return _this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
},
rejected: undefined
}
];
var promise = Promise.resolve(__assign({}, this));
while (chain.length) {
var _a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected;
promise = promise.then(resolved, rejected);
}
];
if (mode === InterfaceCore_1.InterfaceType.JS) {
chain.push({
resolved: function (config) {
// 获取核心接口
var intfCoreInstance = IntfPlatform.getCoreInterface(intfCode);
// 判断核心接口是否存在
if (!intfCoreInstance) {
return Promise.reject({
code: 404,
message: "\u6838\u5FC3\u63A5\u53E3".concat(intfCode, "\u4E0D\u5B58\u5728\uFF01"),
data: null
});
}
else {
try {
return intfCoreInstance.business(code, param);
}
catch (error) {
var message = error.message;
return Promise.reject({
code: 404,
message: message || error,
data: null
});
}
}
},
rejected: undefined
});
// 返回接口结果
return promise;
}
else {
chain.push({
resolved: function (config) {
return _this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
},
rejected: undefined
return IntfPlatform.GetInterfaceInfo(intfCode).then(function (config) {
// 判断接口是否启用
if (config['enabled'] !== 1) {
return Promise.resolve(__assign({}, _this));
}
// 接口授权校验 前端 or 后端
// 校验接口是否有权限
var mode = config['type'] === 'JS' ? InterfaceCore_1.InterfaceType.JS : InterfaceCore_1.InterfaceType.DLL;
var chain = [
{
resolved: function (config) {
return IntfPlatform.authorization(intfCode);
},
rejected: undefined
}
];
if (mode === InterfaceCore_1.InterfaceType.JS) {
chain.push({
resolved: function (config) {
// 获取核心接口
var intfCoreInstance = IntfPlatform.getCoreInterface(intfCode);
// 判断核心接口是否存在
if (!intfCoreInstance) {
return Promise.reject({
code: 404,
message: "\u6838\u5FC3\u63A5\u53E3".concat(intfCode, "\u4E0D\u5B58\u5728\uFF01"),
data: null
});
}
else {
try {
return intfCoreInstance.business(code, param);
}
catch (error) {
var message = error.message;
return Promise.reject({
code: 404,
message: message || error,
data: null
});
}
}
},
rejected: undefined
});
}
else {
chain.push({
resolved: function (config) {
return _this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
},
rejected: undefined
});
}
// icsChromelyRequest.interceptors.response.interceptors.forEach(interceptor => {
// if (interceptor !== null) {
// chain.push(interceptor)
// }
// })
var promise = Promise.resolve(__assign({}, _this));
while (chain.length) {
var _a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected;
promise = promise.then(resolved, rejected);
}
// 返回接口结果
return promise;
// default:
// return this.OperateEx('Business', { intfCode, code, param: JSON.stringify(param) })
// }
});
}
// icsChromelyRequest.interceptors.response.interceptors.forEach(interceptor => {
// if (interceptor !== null) {
// chain.push(interceptor)
// }
// })
var promise = Promise.resolve(__assign({}, this));
while (chain.length) {
var _a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected;
promise = promise.then(resolved, rejected);
}
// 返回接口结果
return promise;
// default:
// return this.OperateEx('Business', { intfCode, code, param: JSON.stringify(param) })
// }
};

@@ -224,9 +301,17 @@ /**

/**
* 实现接口配置
* 实现接口配置(即将弃用)
*/
IntfPlatform.configs = {};
/**
* 核心接口配置
* 核心接口配置(即将弃用)
*/
IntfPlatform.coreConfigs = {};
/**
* 实现接口参数配置对象
*/
IntfPlatform.___intfConfig = {};
/**
* 核心接口参数配置对象
*/
IntfPlatform.___intfInfo = {};
return IntfPlatform;

@@ -233,0 +318,0 @@ }());

@@ -21,10 +21,18 @@ import HBBasicClient from '@icreate/hb-basic-js-sdk';

/**
* 实现接口配置
* 实现接口配置(即将弃用)
*/
private static configs;
/**
* 核心接口配置
* 核心接口配置(即将弃用)
*/
private static coreConfigs;
/**
* 实现接口参数配置对象
*/
private static ___intfConfig;
/**
* 核心接口参数配置对象
*/
private static ___intfInfo;
/**
* 调用C#核心交互接口

@@ -42,2 +50,12 @@ * @param url 路由地址

/**
* 获取接口信息
* @returns 配置选项记录
*/
static GetInterfaceInfo(intfId: string): Promise<any>;
/**
* 获取实现接口配置
* @returns 配置选项记录
*/
static GetInterfaceConfig(intfId: string): Promise<any>;
/**
* 验证授权

@@ -44,0 +62,0 @@ * @param intfCode 接口编码

{
"name": "@imedx/ics-imedx-chromely-plugin-intf-platform",
"version": "0.0.3",
"version": "0.0.4",
"description": "",

@@ -133,4 +133,6 @@ "keywords": [],

"@icreate/ics-chromely-js-sdk": "^0.0.7-beat.7",
"@icreate/ics-chromely-plugin-core": "^0.0.20-beta.11"
"@icreate/ics-chromely-plugin-core": "^0.0.20-beta.11",
"@imedx/ics-imedx-core": "^0.0.1-beta.31",
"@imedx/ics-imedx-intf-chs-js-sdk": "^0.0.3-beta.11"
}
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc