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.
Files changed (58) hide show
  1. package/dist/hina.cjs.js +1 -0
  2. package/dist/hina.esm.full.js +1 -0
  3. package/dist/hina.esm.js +1 -0
  4. package/dist/hina.full.js +1 -0
  5. package/dist/hina.iife.js +1 -0
  6. package/dist/index.d.ts +411 -0
  7. package/package.json +27 -37
  8. package/readme.md +1 -0
  9. package/.eslintrc.js +0 -12
  10. package/.gitlab-ci.yml +0 -16
  11. package/.vscode/settings.json +0 -5
  12. package/build/hina.cjs.min.js +0 -1
  13. package/build/hina.esm.min.js +0 -1
  14. package/build/hina.min.js +0 -1
  15. package/build/hotAnalyse.min.js +0 -1
  16. package/packages/core/dist/index.cjs.js +0 -64
  17. package/packages/core/dist/index.cjs.js.map +0 -1
  18. package/packages/core/dist/index.d.ts +0 -45
  19. package/packages/core/dist/index.esm.js +0 -62
  20. package/packages/core/dist/index.esm.js.map +0 -1
  21. package/packages/core/dist/index.global.js +0 -1199
  22. package/packages/core/dist/index.global.js.map +0 -1
  23. package/packages/core/dist/index.js +0 -1200
  24. package/packages/core/dist/index.js.map +0 -1
  25. package/packages/monitor/dist/index.cjs.js +0 -150
  26. package/packages/monitor/dist/index.cjs.js.map +0 -1
  27. package/packages/monitor/dist/index.d.ts +0 -35
  28. package/packages/monitor/dist/index.esm.js +0 -145
  29. package/packages/monitor/dist/index.esm.js.map +0 -1
  30. package/packages/monitor/dist/index.global.js +0 -1343
  31. package/packages/monitor/dist/index.global.js.map +0 -1
  32. package/packages/monitor/dist/index.js +0 -1344
  33. package/packages/monitor/dist/index.js.map +0 -1
  34. package/packages/track/dist/index.cjs.js +0 -1930
  35. package/packages/track/dist/index.cjs.js.map +0 -1
  36. package/packages/track/dist/index.d.ts +0 -212
  37. package/packages/track/dist/index.esm.js +0 -1925
  38. package/packages/track/dist/index.esm.js.map +0 -1
  39. package/packages/track/dist/index.global.js +0 -4259
  40. package/packages/track/dist/index.global.js.map +0 -1
  41. package/packages/track/dist/index.js +0 -4260
  42. package/packages/track/dist/index.js.map +0 -1
  43. package/packages/types/dist/index.d.ts +0 -603
  44. package/packages/types/dist/index.esm.js +0 -25
  45. package/packages/types/dist/index.esm.js.map +0 -1
  46. package/packages/utils/dist/index.cjs.js +0 -1535
  47. package/packages/utils/dist/index.cjs.js.map +0 -1
  48. package/packages/utils/dist/index.d.ts +0 -394
  49. package/packages/utils/dist/index.esm.js +0 -1465
  50. package/packages/utils/dist/index.esm.js.map +0 -1
  51. package/packages/utils/dist/index.global.js +0 -2507
  52. package/packages/utils/dist/index.global.js.map +0 -1
  53. package/packages/utils/dist/index.js +0 -2508
  54. package/packages/utils/dist/index.js.map +0 -1
  55. package/report.json +0 -101
  56. package/rollup.config.epm.js +0 -42
  57. package/rollup.config.sdk.js +0 -42
  58. 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}