@ohbug/core 1.1.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,693 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.OhbugCore = {}));
5
- }(this, (function (exports) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
-
22
- var __assign = function() {
23
- __assign = Object.assign || function __assign(t) {
24
- for (var s, i = 1, n = arguments.length; i < n; i++) {
25
- s = arguments[i];
26
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
27
- }
28
- return t;
29
- };
30
- return __assign.apply(this, arguments);
31
- };
32
-
33
- function __awaiter(thisArg, _arguments, P, generator) {
34
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
35
- return new (P || (P = Promise))(function (resolve, reject) {
36
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
37
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
38
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
39
- step((generator = generator.apply(thisArg, _arguments || [])).next());
40
- });
41
- }
42
-
43
- function __generator(thisArg, body) {
44
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
45
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
46
- function verb(n) { return function (v) { return step([n, v]); }; }
47
- function step(op) {
48
- if (f) throw new TypeError("Generator is already executing.");
49
- while (_) try {
50
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
51
- if (y = 0, t) op = [op[0] & 2, t.value];
52
- switch (op[0]) {
53
- case 0: case 1: t = op; break;
54
- case 4: _.label++; return { value: op[1], done: false };
55
- case 5: _.label++; y = op[1]; op = [0]; continue;
56
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
57
- default:
58
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
59
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
60
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
61
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
62
- if (t[2]) _.ops.pop();
63
- _.trys.pop(); continue;
64
- }
65
- op = body.call(thisArg, _);
66
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
67
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
68
- }
69
- }
70
-
71
- function __spreadArray$1(to, from) {
72
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
73
- to[j] = from[i];
74
- return to;
75
- }
76
-
77
- /*! *****************************************************************************
78
- Copyright (c) Microsoft Corporation.
79
-
80
- Permission to use, copy, modify, and/or distribute this software for any
81
- purpose with or without fee is hereby granted.
82
-
83
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
84
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
85
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
86
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
87
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
88
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
89
- PERFORMANCE OF THIS SOFTWARE.
90
- ***************************************************************************** */
91
-
92
- function __spreadArray(to, from) {
93
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
94
- to[j] = from[i];
95
- return to;
96
- }
97
-
98
- var prefix = 'Ohbug';
99
- var logger = {
100
- log: function () {
101
- var args = [];
102
- for (var _i = 0; _i < arguments.length; _i++) {
103
- args[_i] = arguments[_i];
104
- }
105
- // eslint-disable-next-line no-console
106
- console.log.apply(console, __spreadArray([prefix], args));
107
- },
108
- info: function () {
109
- var args = [];
110
- for (var _i = 0; _i < arguments.length; _i++) {
111
- args[_i] = arguments[_i];
112
- }
113
- // eslint-disable-next-line no-console
114
- console.info.apply(console, __spreadArray([prefix], args));
115
- },
116
- warn: function () {
117
- var args = [];
118
- for (var _i = 0; _i < arguments.length; _i++) {
119
- args[_i] = arguments[_i];
120
- }
121
- console.warn.apply(console, __spreadArray([prefix], args));
122
- },
123
- error: function () {
124
- var args = [];
125
- for (var _i = 0; _i < arguments.length; _i++) {
126
- args[_i] = arguments[_i];
127
- }
128
- console.error.apply(console, __spreadArray([prefix], args));
129
- },
130
- };
131
-
132
- function isString(value) {
133
- return typeof value === 'string';
134
- }
135
- function isNumber(value) {
136
- return typeof value === 'number' && parseInt("" + value, 10) === value;
137
- }
138
- function isFunction(value) {
139
- return typeof value === 'function';
140
- }
141
- function isObject(value) {
142
- return Object.prototype.toString.call(value) === '[object Object]';
143
- }
144
-
145
- var schema = {
146
- // base
147
- apiKey: {
148
- defaultValue: undefined,
149
- message: 'is required',
150
- validate: function (value) { return Boolean(value) && isString(value); },
151
- },
152
- appVersion: {
153
- defaultValue: undefined,
154
- message: 'should be a string',
155
- validate: function (value) { return value === undefined || isString(value); },
156
- },
157
- appType: {
158
- defaultValue: undefined,
159
- message: 'should be a string',
160
- validate: function (value) { return value === undefined || isString(value); },
161
- },
162
- releaseStage: {
163
- defaultValue: 'production',
164
- message: 'should be a string',
165
- validate: function (value) { return value === undefined || isString(value); },
166
- },
167
- endpoint: {
168
- defaultValue: 'http://localhost:6660/report',
169
- message: 'should be a string',
170
- validate: function (value) { return value === undefined || isString(value); },
171
- },
172
- maxActions: {
173
- defaultValue: 30,
174
- message: 'should be a number between 0 and 100',
175
- validate: function (value) {
176
- return value === undefined || (isNumber(value) && value >= 1 && value <= 100);
177
- },
178
- },
179
- // hooks
180
- created: {
181
- defaultValue: function (event) { return event; },
182
- message: 'should be a function',
183
- validate: function (value) { return value === undefined || isFunction(value); },
184
- },
185
- notified: {
186
- defaultValue: function () { },
187
- message: 'should be a function',
188
- validate: function (value) { return value === undefined || isFunction(value); },
189
- },
190
- // utils
191
- logger: {
192
- defaultValue: logger,
193
- message: 'should be null or an object with methods { log, info, warn, error }',
194
- validate: function (value) {
195
- return value === undefined ||
196
- (value &&
197
- ['log', 'info', 'warn', 'error'].reduce(function (accumulator, method) {
198
- return accumulator && typeof value[method] === 'function';
199
- }, true));
200
- },
201
- },
202
- // data
203
- user: {
204
- defaultValue: undefined,
205
- message: 'should be an object and have up to 6 attributes',
206
- validate: function (value) {
207
- return value === undefined ||
208
- (isObject(value) && Object.keys(value).length <= 6);
209
- },
210
- },
211
- metaData: {
212
- defaultValue: undefined,
213
- message: 'should be an object',
214
- validate: function (value) { return value === undefined || isObject(value); },
215
- },
216
- };
217
-
218
- function createExtension(extension) {
219
- return extension;
220
- }
221
- function createExtensionUI(extensionUI) {
222
- return extensionUI;
223
- }
224
- /**
225
- * Extension loading and initialization
226
- *
227
- * @param extension
228
- * @param client
229
- * @param args
230
- */
231
- function loadExtension(extension, client) {
232
- var _a;
233
- var args = [];
234
- for (var _i = 2; _i < arguments.length; _i++) {
235
- args[_i - 2] = arguments[_i];
236
- }
237
- var result = (_a = extension.init) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spreadArray$1([extension, client], args));
238
- client._extensions.push(extension);
239
- // @ts-ignore
240
- // eslint-disable-next-line no-param-reassign
241
- client._hooks.created = function (_event, _client) {
242
- var _a, _b;
243
- var funcs = __spreadArray$1([
244
- _client._config.created
245
- ], _client._extensions
246
- .filter(function (_a) {
247
- var created = _a.created;
248
- return isFunction(created);
249
- })
250
- .map(function (_a) {
251
- var created = _a.created;
252
- return created;
253
- }));
254
- if (funcs.length === 0)
255
- return (function () {
256
- var arg = [];
257
- for (var _i = 0; _i < arguments.length; _i++) {
258
- arg[_i] = arguments[_i];
259
- }
260
- return arg;
261
- })(_event, _client);
262
- if (funcs.length === 1)
263
- return (_a = funcs[0]) === null || _a === void 0 ? void 0 : _a.call(funcs, _event, _client);
264
- // @ts-ignore
265
- return (_b = funcs.reduce(function (a, b) { return function (event) { return b(a(event, _client), _client); }; })) === null || _b === void 0 ? void 0 : _b(_event, _client);
266
- };
267
- // eslint-disable-next-line no-param-reassign
268
- client._hooks.notified = function (_event, _client) {
269
- return __spreadArray$1([
270
- _client._config.notified
271
- ], _client._extensions
272
- .filter(function (_a) {
273
- var notified = _a.notified;
274
- return isFunction(notified);
275
- })
276
- .map(function (_a) {
277
- var notified = _a.notified;
278
- return notified;
279
- })).forEach(function (func) { return func === null || func === void 0 ? void 0 : func(_event, _client); });
280
- };
281
- return result || client;
282
- }
283
-
284
- var Action = /** @class */ (function () {
285
- function Action(message, data, type, timestamp) {
286
- this.type = type;
287
- this.timestamp = timestamp || new Date().toISOString();
288
- this.message = message;
289
- this.data = data;
290
- }
291
- return Action;
292
- }());
293
-
294
- function getConfigErrorMessage(errors, config) {
295
- return new Error("Invalid configuration\n" + Object.keys(errors)
296
- .map(
297
- // @ts-ignore
298
- function (key) { return "- " + key + " " + errors[key] + ", got " + JSON.stringify(config[key]); })
299
- .join('\n') + "\n ");
300
- }
301
- function getErrorMessage(message, data) {
302
- return new Error("Invalid data\n- " + message + ", got " + JSON.stringify(data));
303
- }
304
-
305
- function addMetaData(map, section, data) {
306
- if (!section)
307
- return;
308
- map[section] = data;
309
- }
310
- function getMetaData(map, section) {
311
- if (map[section]) {
312
- return map[section];
313
- }
314
- return undefined;
315
- }
316
- function deleteMetaData(map, section) {
317
- if (map[section]) {
318
- return delete map[section];
319
- }
320
- return undefined;
321
- }
322
-
323
- var Event = /** @class */ (function () {
324
- function Event(values, client) {
325
- var apiKey = values.apiKey, appVersion = values.appVersion, appType = values.appType, releaseStage = values.releaseStage, timestamp = values.timestamp, category = values.category, type = values.type, sdk = values.sdk, detail = values.detail, device = values.device, user = values.user, actions = values.actions, metaData = values.metaData;
326
- this.apiKey = apiKey;
327
- this.appVersion = appVersion;
328
- this.appType = appType;
329
- this.releaseStage = releaseStage;
330
- this.timestamp = timestamp;
331
- this.category = category;
332
- this.type = type;
333
- this.sdk = sdk;
334
- this.detail = detail;
335
- this.device = device;
336
- this.user = user;
337
- this.actions = actions;
338
- this.metaData = metaData;
339
- this._client = client;
340
- }
341
- Object.defineProperty(Event.prototype, "_isOhbugEvent", {
342
- get: function () {
343
- return true;
344
- },
345
- enumerable: false,
346
- configurable: true
347
- });
348
- /**
349
- * Add an action.
350
- * Once the threshold is reached, the oldest breadcrumbs will be deleted.
351
- * 新增一个动作。
352
- * 一旦达到阈值,最老的 Action 将被删除。
353
- *
354
- * @param message
355
- * @param data
356
- * @param type
357
- * @param timestamp
358
- */
359
- Event.prototype.addAction = function (message, data, type, timestamp) {
360
- var _a, _b;
361
- var actions = this.actions;
362
- var targetMessage = isString(message) ? message : '';
363
- var targetData = data || {};
364
- var targetType = isString(type) ? type : '';
365
- var action = new Action(targetMessage, targetData, targetType, timestamp);
366
- if (actions.length >= ((_b = (_a = this._client) === null || _a === void 0 ? void 0 : _a._config.maxActions) !== null && _b !== void 0 ? _b : 30)) {
367
- actions.shift();
368
- }
369
- actions.push(action);
370
- };
371
- /**
372
- * Get current user information
373
- * 获取当前的用户信息
374
- */
375
- Event.prototype.getUser = function () {
376
- return this.user;
377
- };
378
- /**
379
- * Set current user information
380
- * 设置当前的用户信息
381
- */
382
- Event.prototype.setUser = function (user) {
383
- var _a;
384
- if (isObject(user) && Object.keys(user).length <= 6) {
385
- this.user = __assign(__assign({}, this.user), user);
386
- return this.getUser();
387
- }
388
- (_a = this._client) === null || _a === void 0 ? void 0 : _a._logger.warn(getErrorMessage('setUser should be an object and have up to 6 attributes', user));
389
- return undefined;
390
- };
391
- /**
392
- * Add metaData
393
- * 新增 metaData
394
- *
395
- * @param section
396
- * @param data
397
- */
398
- Event.prototype.addMetaData = function (section, data) {
399
- return addMetaData(this.metaData, section, data);
400
- };
401
- /**
402
- * Get metaData
403
- * 获取 metaData
404
- *
405
- * @param section
406
- */
407
- Event.prototype.getMetaData = function (section) {
408
- return getMetaData(this.metaData, section);
409
- };
410
- /**
411
- * Delete metaData
412
- * 删除 metaData
413
- *
414
- * @param section
415
- */
416
- Event.prototype.deleteMetaData = function (section) {
417
- return deleteMetaData(this.metaData, section);
418
- };
419
- Event.prototype.toJSON = function () {
420
- var _a = this, apiKey = _a.apiKey, appVersion = _a.appVersion, appType = _a.appType, timestamp = _a.timestamp, category = _a.category, type = _a.type, sdk = _a.sdk, device = _a.device, detail = _a.detail, user = _a.user, actions = _a.actions, metaData = _a.metaData, releaseStage = _a.releaseStage;
421
- return {
422
- apiKey: apiKey,
423
- appVersion: appVersion,
424
- appType: appType,
425
- timestamp: timestamp,
426
- category: category,
427
- type: type,
428
- sdk: sdk,
429
- device: device,
430
- detail: detail,
431
- user: user,
432
- actions: actions,
433
- metaData: metaData,
434
- releaseStage: releaseStage,
435
- };
436
- };
437
- return Event;
438
- }());
439
- function createEvent(values, client) {
440
- var _a = client._config, apiKey = _a.apiKey, appVersion = _a.appVersion, appType = _a.appType, releaseStage = _a.releaseStage;
441
- var timestamp = new Date().toISOString();
442
- var device = client._device(client);
443
- var category;
444
- var type;
445
- var detail;
446
- if (isObject(values) &&
447
- Object.prototype.hasOwnProperty.call(values, 'type') &&
448
- Object.prototype.hasOwnProperty.call(values, 'detail')) {
449
- category = values.category || 'error';
450
- type = values.type;
451
- detail = values.detail;
452
- }
453
- else {
454
- category = 'error';
455
- type = 'unknownError';
456
- detail = values;
457
- }
458
- return new Event({
459
- apiKey: apiKey,
460
- appVersion: appVersion,
461
- appType: appType,
462
- timestamp: timestamp,
463
- category: category,
464
- type: type,
465
- sdk: client._sdk,
466
- device: device,
467
- user: client._user,
468
- detail: detail,
469
- actions: client._actions,
470
- metaData: client._metaData,
471
- releaseStage: releaseStage,
472
- }, client);
473
- }
474
- function isEvent(eventLike) {
475
- return Boolean(eventLike === null || eventLike === void 0 ? void 0 : eventLike._isOhbugEvent);
476
- }
477
-
478
- /**
479
- * Used to control the timing of reporting events and the related life cycle.
480
- *
481
- * @param event
482
- * @param client
483
- */
484
- function notify(event, client) {
485
- return __awaiter(this, void 0, void 0, function () {
486
- var result, e_1;
487
- return __generator(this, function (_a) {
488
- switch (_a.label) {
489
- case 0:
490
- _a.trys.push([0, 3, , 4]);
491
- result = null;
492
- if (!event) return [3 /*break*/, 2];
493
- return [4 /*yield*/, client._notifier(event)];
494
- case 1:
495
- result = _a.sent();
496
- _a.label = 2;
497
- case 2:
498
- if (isFunction(client._hooks.notified)) {
499
- client._hooks.notified(event, client);
500
- }
501
- return [2 /*return*/, result];
502
- case 3:
503
- e_1 = _a.sent();
504
- client._logger.error(e_1);
505
- return [3 /*break*/, 4];
506
- case 4: return [2 /*return*/];
507
- }
508
- });
509
- });
510
- }
511
-
512
- function verifyConfig(config, schema) {
513
- var keys = Object.keys(schema);
514
- return keys.reduce(function (accumulator, key) {
515
- var configValue = config[key];
516
- var _a = schema[key], defaultValue = _a.defaultValue, message = _a.message, validate = _a.validate;
517
- if (configValue !== undefined) {
518
- var valid = validate(configValue);
519
- if (valid) {
520
- accumulator.config[key] = configValue;
521
- }
522
- else {
523
- accumulator.config[key] = defaultValue;
524
- accumulator.errors[key] = message;
525
- }
526
- }
527
- else {
528
- // if there is no corresponding configuration, use the default value
529
- // 如果没有传入相应配置 使用默认值
530
- accumulator.config[key] = defaultValue;
531
- }
532
- return accumulator;
533
- }, {
534
- config: {},
535
- errors: {},
536
- });
537
- }
538
-
539
- var Client = /** @class */ (function () {
540
- function Client(_a) {
541
- var _this = this;
542
- var sdk = _a.sdk, baseConfig = _a.config, _b = _a.schema, schema$1 = _b === void 0 ? schema : _b, device = _a.device, notifier = _a.notifier;
543
- var _c = verifyConfig(baseConfig, schema$1), config = _c.config, errors = _c.errors;
544
- // initialization
545
- this._sdk = sdk;
546
- this._config = config;
547
- this._logger = config.logger;
548
- this._device = device;
549
- this._notifier = notifier;
550
- this._extensions = [];
551
- this._hooks = {
552
- created: config.created,
553
- notified: config.notified,
554
- };
555
- this._actions = [];
556
- this._user = config.user;
557
- this._metaData = {};
558
- if (isObject(config.metaData)) {
559
- Object.keys(config.metaData).forEach(function (key) {
560
- _this.addMetaData(key, config.metaData[key]);
561
- });
562
- }
563
- if (Object.keys(errors).length) {
564
- this._logger.warn(getConfigErrorMessage(errors, baseConfig));
565
- }
566
- }
567
- /**
568
- * Load extension
569
- * 加载扩展
570
- *
571
- * @param extension
572
- * @param args
573
- */
574
- Client.prototype.use = function (extension) {
575
- var args = [];
576
- for (var _i = 1; _i < arguments.length; _i++) {
577
- args[_i - 1] = arguments[_i];
578
- }
579
- return loadExtension.apply(void 0, __spreadArray$1([extension, this], args));
580
- };
581
- /**
582
- * Create an event, you will get a data body containing device actions and other information
583
- * 创建事件,将会得到一个含有 device actions 等信息的数据体
584
- *
585
- * @param value
586
- */
587
- Client.prototype.createEvent = function (value) {
588
- var event = createEvent(value, this);
589
- if (isFunction(this._hooks.created)) {
590
- // trigger created hook
591
- return this._hooks.created(event, this);
592
- }
593
- return event;
594
- };
595
- /**
596
- * Used to trigger the reporting interface
597
- * 用于触发上报接口
598
- *
599
- * @param eventLike
600
- * @param beforeNotify
601
- */
602
- Client.prototype.notify = function (eventLike, beforeNotify) {
603
- var event;
604
- if (Boolean(eventLike) && !isEvent(eventLike)) {
605
- event = this.createEvent(eventLike);
606
- }
607
- else {
608
- event = eventLike;
609
- }
610
- if (beforeNotify)
611
- event = beforeNotify(event);
612
- return notify(event, this);
613
- };
614
- /**
615
- * Add an action.
616
- * Once the threshold is reached, the oldest breadcrumbs will be deleted.
617
- * 新增一个动作。
618
- * 一旦达到阈值,最老的 Action 将被删除。
619
- *
620
- * @param message
621
- * @param data
622
- * @param type
623
- * @param timestamp
624
- */
625
- Client.prototype.addAction = function (message, data, type, timestamp) {
626
- var actions = this._actions;
627
- var targetMessage = isString(message) ? message : '';
628
- var targetData = data || {};
629
- var targetType = isString(type) ? type : '';
630
- var action = new Action(targetMessage, targetData, targetType, timestamp);
631
- if (actions.length >= this._config.maxActions) {
632
- actions.shift();
633
- }
634
- actions.push(action);
635
- };
636
- /**
637
- * Get current user information
638
- * 获取当前的用户信息
639
- */
640
- Client.prototype.getUser = function () {
641
- return this._user;
642
- };
643
- /**
644
- * Set current user information
645
- * 设置当前的用户信息
646
- */
647
- Client.prototype.setUser = function (user) {
648
- if (isObject(user) && Object.keys(user).length <= 6) {
649
- this._user = __assign(__assign({}, this._user), user);
650
- return this.getUser();
651
- }
652
- this._logger.warn(getErrorMessage('setUser should be an object and have up to 6 attributes', user));
653
- return undefined;
654
- };
655
- /**
656
- * Add metaData
657
- * 新增 metaData
658
- *
659
- * @param section
660
- * @param data
661
- */
662
- Client.prototype.addMetaData = function (section, data) {
663
- return addMetaData(this._metaData, section, data);
664
- };
665
- /**
666
- * Get metaData
667
- * 获取 metaData
668
- *
669
- * @param section
670
- */
671
- Client.prototype.getMetaData = function (section) {
672
- return getMetaData(this._metaData, section);
673
- };
674
- /**
675
- * Delete metaData
676
- * 删除 metaData
677
- *
678
- * @param section
679
- */
680
- Client.prototype.deleteMetaData = function (section) {
681
- return deleteMetaData(this._metaData, section);
682
- };
683
- return Client;
684
- }());
685
-
686
- exports.Client = Client;
687
- exports.createExtension = createExtension;
688
- exports.createExtensionUI = createExtensionUI;
689
- exports.isEvent = isEvent;
690
-
691
- Object.defineProperty(exports, '__esModule', { value: true });
692
-
693
- })));