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
16
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.2 to 0.0.3

127

dist/ics-imedx-chromely-plugin-intf-platform.es5.js
import icsChromelyRequest from '@icreate/ics-chromely-js-sdk';
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
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.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
/**

@@ -114,9 +140,28 @@ * 接口响应

IntfPlatform.GetInterfaceType = function (intfCode) {
return InterfaceType.DLL;
return IntfPlatform.coreInterfaces[intfCode] ? InterfaceType.JS : InterfaceType.DLL;
};
/**
* 验证授权
* @param intfCode 接口编码
* @returns Promise
*/
IntfPlatform.authorization = function (intfCode) {
// return this.hbbasic.api.authorization(
// {
// orgId: this.orgId,
// apiId: intfCode
// },
// true
// )
return Promise.resolve();
};
/**
*
* @param orgId 机构编号
* @param hbBasicClient hbBasic接口
* @returns 成功:{code: 200, data, message: 'ok'}
*/
IntfPlatform.init = function () {
IntfPlatform.init = function (orgId, hbBasicClient) {
this.orgId = orgId;
this.hbbasic = hbBasicClient;
return this.OperateEx('Init');

@@ -139,16 +184,68 @@ };

IntfPlatform.bussiness = function (intfCode, code, param) {
var mode = this.GetInterfaceType(intfCode);
switch (mode) {
case InterfaceType.JS:
// 获取核心接口
var intfCoreInstance = IntfPlatform.getCoreInterface(intfCode);
// 判断核心接口是否存在
if (!intfCoreInstance) {
return Promise.reject("\u6838\u5FC3\u63A5\u53E3".concat(intfCode, "\u4E0D\u5B58\u5728\uFF01"));
}
// 返回接口结果
return Promise.resolve(intfCoreInstance.business(code, param));
default:
return this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
var _this = this;
// 校验接口是否有权限
var mode = IntfPlatform.GetInterfaceType(intfCode);
// switch (mode) {
// case InterfaceType.JS:
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) })
// }
};

@@ -155,0 +252,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));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.IcsImedxChromelyPluginIntfPlatform = {}, global.IcsChromelyRequest));
})(this, (function (exports, icsChromelyRequest) { 'use strict';
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
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.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
/**

@@ -118,9 +144,28 @@ * 接口响应

IntfPlatform.GetInterfaceType = function (intfCode) {
return exports.InterfaceType.DLL;
return IntfPlatform.coreInterfaces[intfCode] ? exports.InterfaceType.JS : exports.InterfaceType.DLL;
};
/**
* 验证授权
* @param intfCode 接口编码
* @returns Promise
*/
IntfPlatform.authorization = function (intfCode) {
// return this.hbbasic.api.authorization(
// {
// orgId: this.orgId,
// apiId: intfCode
// },
// true
// )
return Promise.resolve();
};
/**
*
* @param orgId 机构编号
* @param hbBasicClient hbBasic接口
* @returns 成功:{code: 200, data, message: 'ok'}
*/
IntfPlatform.init = function () {
IntfPlatform.init = function (orgId, hbBasicClient) {
this.orgId = orgId;
this.hbbasic = hbBasicClient;
return this.OperateEx('Init');

@@ -143,16 +188,68 @@ };

IntfPlatform.bussiness = function (intfCode, code, param) {
var mode = this.GetInterfaceType(intfCode);
switch (mode) {
case exports.InterfaceType.JS:
// 获取核心接口
var intfCoreInstance = IntfPlatform.getCoreInterface(intfCode);
// 判断核心接口是否存在
if (!intfCoreInstance) {
return Promise.reject("\u6838\u5FC3\u63A5\u53E3".concat(intfCode, "\u4E0D\u5B58\u5728\uFF01"));
}
// 返回接口结果
return Promise.resolve(intfCoreInstance.business(code, param));
default:
return this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
var _this = this;
// 校验接口是否有权限
var mode = IntfPlatform.GetInterfaceType(intfCode);
// switch (mode) {
// case InterfaceType.JS:
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) })
// }
};

@@ -159,0 +256,0 @@ /**

"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -26,9 +37,28 @@ var ics_chromely_js_sdk_1 = require("@icreate/ics-chromely-js-sdk");

IntfPlatform.GetInterfaceType = function (intfCode) {
return InterfaceCore_1.InterfaceType.DLL;
return IntfPlatform.coreInterfaces[intfCode] ? InterfaceCore_1.InterfaceType.JS : InterfaceCore_1.InterfaceType.DLL;
};
/**
* 验证授权
* @param intfCode 接口编码
* @returns Promise
*/
IntfPlatform.authorization = function (intfCode) {
// return this.hbbasic.api.authorization(
// {
// orgId: this.orgId,
// apiId: intfCode
// },
// true
// )
return Promise.resolve();
};
/**
*
* @param orgId 机构编号
* @param hbBasicClient hbBasic接口
* @returns 成功:{code: 200, data, message: 'ok'}
*/
IntfPlatform.init = function () {
IntfPlatform.init = function (orgId, hbBasicClient) {
this.orgId = orgId;
this.hbbasic = hbBasicClient;
return this.OperateEx('Init');

@@ -51,16 +81,68 @@ };

IntfPlatform.bussiness = function (intfCode, code, param) {
var mode = this.GetInterfaceType(intfCode);
switch (mode) {
case InterfaceCore_1.InterfaceType.JS:
// 获取核心接口
var intfCoreInstance = IntfPlatform.getCoreInterface(intfCode);
// 判断核心接口是否存在
if (!intfCoreInstance) {
return Promise.reject("\u6838\u5FC3\u63A5\u53E3".concat(intfCode, "\u4E0D\u5B58\u5728\uFF01"));
}
// 返回接口结果
return Promise.resolve(intfCoreInstance.business(code, param));
default:
return this.OperateEx('Business', { intfCode: intfCode, code: code, param: JSON.stringify(param) });
var _this = this;
// 校验接口是否有权限
var mode = IntfPlatform.GetInterfaceType(intfCode);
// switch (mode) {
// case InterfaceType.JS:
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) })
// }
};

@@ -67,0 +149,0 @@ /**

4

dist/types/interfaces/InterfaceCore.d.ts

@@ -10,3 +10,3 @@ /**

*/
business(code: string, param: any): IntfResponse;
business(code: string, param: any): Promise<IntfResponse>;
}

@@ -32,3 +32,3 @@ /**

*/
abstract business(code: string, param: any): IntfResponse;
abstract business(code: string, param: any): Promise<IntfResponse>;
/**

@@ -35,0 +35,0 @@ * 200成功返回

@@ -0,4 +1,13 @@

import HBBasicClient from '@icreate/hb-basic-js-sdk';
import { ConfigRecord, IInterfaceCore } from './interfaces/InterfaceCore';
export default class IntfPlatform {
/**
* 机构ID
*/
private static orgId;
/**
* hbbasic接口
*/
private static hbbasic;
/**
* 实现接口列表

@@ -32,6 +41,14 @@ */

/**
* 验证授权
* @param intfCode 接口编码
* @returns Promise
*/
static authorization(intfCode: string): Promise<any>;
/**
*
* @param orgId 机构编号
* @param hbBasicClient hbBasic接口
* @returns 成功:{code: 200, data, message: 'ok'}
*/
static init(): Promise<any>;
static init(orgId: string, hbBasicClient: HBBasicClient): Promise<any>;
/**

@@ -38,0 +55,0 @@ *

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

@@ -89,2 +89,3 @@ "keywords": [],

"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-html": "^1.0.2",
"@rollup/plugin-json": "^6.0.0",

@@ -109,2 +110,3 @@ "@rollup/plugin-node-resolve": "^15.0.2",

"lodash.camelcase": "^4.3.0",
"lodash.upperfirst": "^4.3.1",
"package-tls": "^1.2.2",

@@ -131,9 +133,6 @@ "path": "^0.12.7",

"dependencies": {
"@icreate/ics-chromely-js-sdk": "^0.0.4-beta.1",
"@imedx/ics-imedx-chromely-plugin-intf-platform": "^0.0.1-beta.13",
"@rollup/plugin-html": "^1.0.2",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-sass": "^1.12.19",
"rollup-plugin-serve": "^2.0.2"
"@icreate/hb-basic-js-sdk": "^0.0.17-beta.19",
"@icreate/ics-chromely-js-sdk": "^0.0.7-beat.7",
"@icreate/ics-chromely-plugin-core": "^0.0.20-beta.11"
}
}

@@ -0,0 +0,0 @@ ### 引入

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