@imedx/ics-imedx-chromely-plugin-intf-platform
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -18,3 +18,19 @@ import icsChromelyRequest from '@icreate/ics-chromely-js-sdk'; | ||
***************************************************************************** */ | ||
/* global Reflect, Promise, SuppressedError, Symbol */ | ||
var extendStatics = function(d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
function __extends(d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
var __assign = function() { | ||
@@ -31,2 +47,7 @@ __assign = Object.assign || function __assign(t) { | ||
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { | ||
var e = new Error(message); | ||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; | ||
}; | ||
/** | ||
@@ -54,2 +75,8 @@ * 接口响应 | ||
/** | ||
* 接口初始化 | ||
*/ | ||
BaseInterfaceCore.prototype.init = function () { | ||
return Promise.resolve(new IntfResponse(200, 'ok', null)); | ||
}; | ||
/** | ||
* 200成功返回 | ||
@@ -122,2 +149,22 @@ * @param data 成功数据 | ||
})(InterfaceType || (InterfaceType = {})); | ||
var IntfEnableError = /** @class */ (function (_super) { | ||
__extends(IntfEnableError, _super); | ||
function IntfEnableError(message) { | ||
if (message === void 0) { message = ''; } | ||
var _this = _super.call(this, message) || this; | ||
_this.name = 'IntfEnableError'; | ||
return _this; | ||
} | ||
return IntfEnableError; | ||
}(Error)); | ||
/** @class */ ((function (_super) { | ||
__extends(IntAuthorizationError, _super); | ||
function IntAuthorizationError(message) { | ||
if (message === void 0) { message = ''; } | ||
var _this = _super.call(this, message) || this; | ||
_this.name = 'IntfEnableError'; | ||
return _this; | ||
} | ||
return IntAuthorizationError; | ||
})(Error)); | ||
@@ -151,2 +198,9 @@ var IntfPlatform = /** @class */ (function () { | ||
*/ | ||
IntfPlatform.getInterfaceInfo = function (intfId) { | ||
return IntfPlatform.GetInterfaceInfo(intfId); | ||
}; | ||
/** | ||
* 获取接口信息 | ||
* @returns 配置选项记录 | ||
*/ | ||
IntfPlatform.GetInterfaceInfo = function (intfId) { | ||
@@ -216,2 +270,12 @@ if (IntfPlatform.___intfInfo[intfId]) { | ||
this.hbbasic = hbBasicClient; | ||
// 初始化所有核心接口 | ||
var coreInterfaces = IntfPlatform.getAllCoreInterface(); | ||
for (var key in coreInterfaces) { | ||
if (coreInterfaces.hasOwnProperty(key)) { | ||
var coreInterface = IntfPlatform.getCoreInterface(key); | ||
if (coreInterface && coreInterface.init) { | ||
coreInterface.init(); | ||
} | ||
} | ||
} | ||
return this.OperateEx('Init'); | ||
@@ -264,3 +328,3 @@ }; | ||
if (config['enabled'] !== 1) { | ||
return Promise.resolve(__assign({}, _this)); | ||
return Promise.reject(new IntfEnableError('接口开关未开启')); | ||
} | ||
@@ -373,3 +437,4 @@ // 接口授权校验 前端 or 后端 | ||
IntfPlatform.getCoreInterfaceConfig = function (name) { | ||
return IntfPlatform.configs[name]; | ||
// return IntfPlatform.configs[name] | ||
return IntfPlatform.GetInterfaceInfo(name); | ||
}; | ||
@@ -398,3 +463,4 @@ /** | ||
IntfPlatform.getInterfaceConfig = function (name) { | ||
return IntfPlatform.configs[name]; | ||
// return IntfPlatform.configs[name] | ||
return IntfPlatform.GetInterfaceConfig(name); | ||
}; | ||
@@ -401,0 +467,0 @@ /** |
@@ -21,3 +21,19 @@ (function (global, factory) { | ||
***************************************************************************** */ | ||
/* global Reflect, Promise, SuppressedError, Symbol */ | ||
var extendStatics = function(d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
function __extends(d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
var __assign = function() { | ||
@@ -34,2 +50,7 @@ __assign = Object.assign || function __assign(t) { | ||
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { | ||
var e = new Error(message); | ||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; | ||
}; | ||
/** | ||
@@ -57,2 +78,8 @@ * 接口响应 | ||
/** | ||
* 接口初始化 | ||
*/ | ||
BaseInterfaceCore.prototype.init = function () { | ||
return Promise.resolve(new IntfResponse(200, 'ok', null)); | ||
}; | ||
/** | ||
* 200成功返回 | ||
@@ -125,2 +152,22 @@ * @param data 成功数据 | ||
})(exports.InterfaceType || (exports.InterfaceType = {})); | ||
var IntfEnableError = /** @class */ (function (_super) { | ||
__extends(IntfEnableError, _super); | ||
function IntfEnableError(message) { | ||
if (message === void 0) { message = ''; } | ||
var _this = _super.call(this, message) || this; | ||
_this.name = 'IntfEnableError'; | ||
return _this; | ||
} | ||
return IntfEnableError; | ||
}(Error)); | ||
/** @class */ ((function (_super) { | ||
__extends(IntAuthorizationError, _super); | ||
function IntAuthorizationError(message) { | ||
if (message === void 0) { message = ''; } | ||
var _this = _super.call(this, message) || this; | ||
_this.name = 'IntfEnableError'; | ||
return _this; | ||
} | ||
return IntAuthorizationError; | ||
})(Error)); | ||
@@ -154,2 +201,9 @@ var IntfPlatform = /** @class */ (function () { | ||
*/ | ||
IntfPlatform.getInterfaceInfo = function (intfId) { | ||
return IntfPlatform.GetInterfaceInfo(intfId); | ||
}; | ||
/** | ||
* 获取接口信息 | ||
* @returns 配置选项记录 | ||
*/ | ||
IntfPlatform.GetInterfaceInfo = function (intfId) { | ||
@@ -219,2 +273,12 @@ if (IntfPlatform.___intfInfo[intfId]) { | ||
this.hbbasic = hbBasicClient; | ||
// 初始化所有核心接口 | ||
var coreInterfaces = IntfPlatform.getAllCoreInterface(); | ||
for (var key in coreInterfaces) { | ||
if (coreInterfaces.hasOwnProperty(key)) { | ||
var coreInterface = IntfPlatform.getCoreInterface(key); | ||
if (coreInterface && coreInterface.init) { | ||
coreInterface.init(); | ||
} | ||
} | ||
} | ||
return this.OperateEx('Init'); | ||
@@ -267,3 +331,3 @@ }; | ||
if (config['enabled'] !== 1) { | ||
return Promise.resolve(__assign({}, _this)); | ||
return Promise.reject(new IntfEnableError('接口开关未开启')); | ||
} | ||
@@ -376,3 +440,4 @@ // 接口授权校验 前端 or 后端 | ||
IntfPlatform.getCoreInterfaceConfig = function (name) { | ||
return IntfPlatform.configs[name]; | ||
// return IntfPlatform.configs[name] | ||
return IntfPlatform.GetInterfaceInfo(name); | ||
}; | ||
@@ -401,3 +466,4 @@ /** | ||
IntfPlatform.getInterfaceConfig = function (name) { | ||
return IntfPlatform.configs[name]; | ||
// return IntfPlatform.configs[name] | ||
return IntfPlatform.GetInterfaceConfig(name); | ||
}; | ||
@@ -404,0 +470,0 @@ /** |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InterfaceType = exports.InterfaceParamType = exports.intfParam = exports.BaseInterfaceCore = exports.IntfResponse = void 0; | ||
exports.IntAuthorizationError = exports.IntfEnableError = exports.InterfaceType = exports.InterfaceParamType = exports.intfParam = exports.BaseInterfaceCore = exports.IntfResponse = void 0; | ||
/** | ||
@@ -27,2 +42,8 @@ * 接口响应 | ||
/** | ||
* 接口初始化 | ||
*/ | ||
BaseInterfaceCore.prototype.init = function () { | ||
return Promise.resolve(new IntfResponse(200, 'ok', null)); | ||
}; | ||
/** | ||
* 200成功返回 | ||
@@ -97,2 +118,24 @@ * @param data 成功数据 | ||
})(InterfaceType = exports.InterfaceType || (exports.InterfaceType = {})); | ||
var IntfEnableError = /** @class */ (function (_super) { | ||
__extends(IntfEnableError, _super); | ||
function IntfEnableError(message) { | ||
if (message === void 0) { message = ''; } | ||
var _this = _super.call(this, message) || this; | ||
_this.name = 'IntfEnableError'; | ||
return _this; | ||
} | ||
return IntfEnableError; | ||
}(Error)); | ||
exports.IntfEnableError = IntfEnableError; | ||
var IntAuthorizationError = /** @class */ (function (_super) { | ||
__extends(IntAuthorizationError, _super); | ||
function IntAuthorizationError(message) { | ||
if (message === void 0) { message = ''; } | ||
var _this = _super.call(this, message) || this; | ||
_this.name = 'IntfEnableError'; | ||
return _this; | ||
} | ||
return IntAuthorizationError; | ||
}(Error)); | ||
exports.IntAuthorizationError = IntAuthorizationError; | ||
//# sourceMappingURL=InterfaceCore.js.map |
@@ -44,2 +44,9 @@ "use strict"; | ||
*/ | ||
IntfPlatform.getInterfaceInfo = function (intfId) { | ||
return IntfPlatform.GetInterfaceInfo(intfId); | ||
}; | ||
/** | ||
* 获取接口信息 | ||
* @returns 配置选项记录 | ||
*/ | ||
IntfPlatform.GetInterfaceInfo = function (intfId) { | ||
@@ -109,2 +116,12 @@ if (IntfPlatform.___intfInfo[intfId]) { | ||
this.hbbasic = hbBasicClient; | ||
// 初始化所有核心接口 | ||
var coreInterfaces = IntfPlatform.getAllCoreInterface(); | ||
for (var key in coreInterfaces) { | ||
if (coreInterfaces.hasOwnProperty(key)) { | ||
var coreInterface = IntfPlatform.getCoreInterface(key); | ||
if (coreInterface && coreInterface.init) { | ||
coreInterface.init(); | ||
} | ||
} | ||
} | ||
return this.OperateEx('Init'); | ||
@@ -157,3 +174,3 @@ }; | ||
if (config['enabled'] !== 1) { | ||
return Promise.resolve(__assign({}, _this)); | ||
return Promise.reject(new InterfaceCore_1.IntfEnableError('接口开关未开启')); | ||
} | ||
@@ -266,3 +283,4 @@ // 接口授权校验 前端 or 后端 | ||
IntfPlatform.getCoreInterfaceConfig = function (name) { | ||
return IntfPlatform.configs[name]; | ||
// return IntfPlatform.configs[name] | ||
return IntfPlatform.GetInterfaceInfo(name); | ||
}; | ||
@@ -291,3 +309,4 @@ /** | ||
IntfPlatform.getInterfaceConfig = function (name) { | ||
return IntfPlatform.configs[name]; | ||
// return IntfPlatform.configs[name] | ||
return IntfPlatform.GetInterfaceConfig(name); | ||
}; | ||
@@ -294,0 +313,0 @@ /** |
@@ -6,2 +6,6 @@ /** | ||
/** | ||
* 初始化 | ||
*/ | ||
init(): Promise<IntfResponse>; | ||
/** | ||
* 业务交互接口 | ||
@@ -28,2 +32,6 @@ * @param code 交易码 | ||
/** | ||
* 接口初始化 | ||
*/ | ||
init(): Promise<IntfResponse>; | ||
/** | ||
* | ||
@@ -95,1 +103,7 @@ * @param code | ||
export type ConfigRecord = Record<string, intfParam>; | ||
export declare class IntfEnableError extends Error { | ||
constructor(message?: string); | ||
} | ||
export declare class IntAuthorizationError extends Error { | ||
constructor(message?: string); | ||
} |
@@ -52,2 +52,7 @@ import HBBasicClient from '@icreate/hb-basic-js-sdk'; | ||
*/ | ||
static getInterfaceInfo(intfId: string): Promise<any>; | ||
/** | ||
* 获取接口信息 | ||
* @returns 配置选项记录 | ||
*/ | ||
static GetInterfaceInfo(intfId: string): Promise<any>; | ||
@@ -109,3 +114,3 @@ /** | ||
*/ | ||
static getCoreInterfaceConfig(name: string): ConfigRecord | undefined; | ||
static getCoreInterfaceConfig(name: string): Promise<any>; | ||
/** | ||
@@ -127,3 +132,3 @@ * 获取所有实现接口 | ||
*/ | ||
static getInterfaceConfig(name: string): ConfigRecord | undefined; | ||
static getInterfaceConfig(name: string): Promise<any>; | ||
} |
{ | ||
"name": "@imedx/ics-imedx-chromely-plugin-intf-platform", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
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
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
138803
1717