hina-cloud-js-sdk 3.1.8 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/hina.cjs.js +1 -0
- package/dist/hina.esm.full.js +1 -0
- package/dist/hina.esm.js +1 -0
- package/dist/hina.full.js +1 -0
- package/dist/hina.iife.js +1 -0
- package/dist/index.d.ts +411 -0
- package/package.json +27 -37
- package/readme.md +1 -0
- package/.eslintrc.js +0 -12
- package/.gitlab-ci.yml +0 -16
- package/.vscode/settings.json +0 -5
- package/build/hina.cjs.min.js +0 -1
- package/build/hina.esm.min.js +0 -1
- package/build/hina.min.js +0 -1
- package/build/hotAnalyse.min.js +0 -1
- package/packages/core/dist/index.cjs.js +0 -64
- package/packages/core/dist/index.cjs.js.map +0 -1
- package/packages/core/dist/index.d.ts +0 -45
- package/packages/core/dist/index.esm.js +0 -62
- package/packages/core/dist/index.esm.js.map +0 -1
- package/packages/core/dist/index.global.js +0 -1199
- package/packages/core/dist/index.global.js.map +0 -1
- package/packages/core/dist/index.js +0 -1200
- package/packages/core/dist/index.js.map +0 -1
- package/packages/monitor/dist/index.cjs.js +0 -150
- package/packages/monitor/dist/index.cjs.js.map +0 -1
- package/packages/monitor/dist/index.d.ts +0 -35
- package/packages/monitor/dist/index.esm.js +0 -145
- package/packages/monitor/dist/index.esm.js.map +0 -1
- package/packages/monitor/dist/index.global.js +0 -1343
- package/packages/monitor/dist/index.global.js.map +0 -1
- package/packages/monitor/dist/index.js +0 -1344
- package/packages/monitor/dist/index.js.map +0 -1
- package/packages/track/dist/index.cjs.js +0 -1930
- package/packages/track/dist/index.cjs.js.map +0 -1
- package/packages/track/dist/index.d.ts +0 -212
- package/packages/track/dist/index.esm.js +0 -1925
- package/packages/track/dist/index.esm.js.map +0 -1
- package/packages/track/dist/index.global.js +0 -4259
- package/packages/track/dist/index.global.js.map +0 -1
- package/packages/track/dist/index.js +0 -4260
- package/packages/track/dist/index.js.map +0 -1
- package/packages/types/dist/index.d.ts +0 -603
- package/packages/types/dist/index.esm.js +0 -25
- package/packages/types/dist/index.esm.js.map +0 -1
- package/packages/utils/dist/index.cjs.js +0 -1535
- package/packages/utils/dist/index.cjs.js.map +0 -1
- package/packages/utils/dist/index.d.ts +0 -394
- package/packages/utils/dist/index.esm.js +0 -1465
- package/packages/utils/dist/index.esm.js.map +0 -1
- package/packages/utils/dist/index.global.js +0 -2507
- package/packages/utils/dist/index.global.js.map +0 -1
- package/packages/utils/dist/index.js +0 -2508
- package/packages/utils/dist/index.js.map +0 -1
- package/report.json +0 -101
- package/rollup.config.epm.js +0 -42
- package/rollup.config.sdk.js +0 -42
- package/sonar-project.properties +0 -3
@@ -1,45 +0,0 @@
|
|
1
|
-
import { BaseOptions, ConsoleTypes, PluginBase, IAnyObject, AnyFn, ReportType } from 'hina-cloud-types';
|
2
|
-
|
3
|
-
declare abstract class BaseCore<O extends BaseOptions> {
|
4
|
-
/**
|
5
|
-
* 配置信息
|
6
|
-
*/
|
7
|
-
options: O;
|
8
|
-
/**
|
9
|
-
* SDK是否已准备就绪
|
10
|
-
*/
|
11
|
-
isReady: boolean;
|
12
|
-
/**
|
13
|
-
* 控制台前缀
|
14
|
-
*/
|
15
|
-
consolePrefix: string;
|
16
|
-
/**
|
17
|
-
* 初始化SDK的方式,默认为true,即通过new的方式初始化SDK,如果使用函数调用初始化SDK,则设置为false
|
18
|
-
*/
|
19
|
-
useInstancing: boolean;
|
20
|
-
protected constructor(options: O, useInstancing?: boolean);
|
21
|
-
/**
|
22
|
-
* 打印日志
|
23
|
-
* @param message 日志消息
|
24
|
-
* @param type 日志类型
|
25
|
-
*/
|
26
|
-
log(message: any, type?: ConsoleTypes): void;
|
27
|
-
/**
|
28
|
-
* 执行插件
|
29
|
-
* @param plugins
|
30
|
-
*/
|
31
|
-
runPlugins(plugins: PluginBase<BaseOptions>[]): void;
|
32
|
-
/**
|
33
|
-
* 抽象方法 注册/初始化SDK
|
34
|
-
*/
|
35
|
-
abstract init(options: O): Promise<void> | void;
|
36
|
-
/**
|
37
|
-
* 抽象方法,端的请求方式不一致,需要自己实现
|
38
|
-
* @param data 上报的数据
|
39
|
-
* @param callback 回调函数
|
40
|
-
* @param type 发送方式
|
41
|
-
*/
|
42
|
-
abstract report(data: IAnyObject, callback?: AnyFn, type?: ReportType): void;
|
43
|
-
}
|
44
|
-
|
45
|
-
export { BaseCore };
|
@@ -1,62 +0,0 @@
|
|
1
|
-
import { ConsoleTypes } from 'hina-cloud-types';
|
2
|
-
import { supportConsole, log } from 'hina-cloud-utils';
|
3
|
-
|
4
|
-
var BaseCore = /** @class */ (function () {
|
5
|
-
function BaseCore(options, useInstancing) {
|
6
|
-
if (useInstancing === void 0) { useInstancing = true; }
|
7
|
-
/**
|
8
|
-
* SDK是否已准备就绪
|
9
|
-
*/
|
10
|
-
this.isReady = false;
|
11
|
-
/**
|
12
|
-
* 控制台前缀
|
13
|
-
*/
|
14
|
-
this.consolePrefix = '';
|
15
|
-
/**
|
16
|
-
* 初始化SDK的方式,默认为true,即通过new的方式初始化SDK,如果使用函数调用初始化SDK,则设置为false
|
17
|
-
*/
|
18
|
-
this.useInstancing = true;
|
19
|
-
this.options = options;
|
20
|
-
this.useInstancing = useInstancing;
|
21
|
-
}
|
22
|
-
/**
|
23
|
-
* 打印日志
|
24
|
-
* @param message 日志消息
|
25
|
-
* @param type 日志类型
|
26
|
-
*/
|
27
|
-
BaseCore.prototype.log = function (message, type) {
|
28
|
-
if (type === void 0) { type = ConsoleTypes.LOG; }
|
29
|
-
var showLog = this.options.showLog;
|
30
|
-
if (!supportConsole() || !showLog)
|
31
|
-
return;
|
32
|
-
if (typeof message === 'string' && this.consolePrefix) {
|
33
|
-
message = "".concat(this.consolePrefix, "\uFF1A").concat(message);
|
34
|
-
}
|
35
|
-
log(message, type);
|
36
|
-
};
|
37
|
-
/**
|
38
|
-
* 执行插件
|
39
|
-
* @param plugins
|
40
|
-
*/
|
41
|
-
BaseCore.prototype.runPlugins = function (plugins) {
|
42
|
-
var _this = this;
|
43
|
-
var _loop_1 = function (i) {
|
44
|
-
var plugin = plugins[i];
|
45
|
-
plugin.init(function (data) {
|
46
|
-
if (!plugin.transform)
|
47
|
-
return;
|
48
|
-
var result = plugin.transform(data);
|
49
|
-
if (!result)
|
50
|
-
return;
|
51
|
-
_this.report(result);
|
52
|
-
});
|
53
|
-
};
|
54
|
-
for (var i = 0; i < plugins.length; i++) {
|
55
|
-
_loop_1(i);
|
56
|
-
}
|
57
|
-
};
|
58
|
-
return BaseCore;
|
59
|
-
}());
|
60
|
-
|
61
|
-
export { BaseCore };
|
62
|
-
//# sourceMappingURL=index.esm.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|