@cloudcare/rum-uniapp 2.1.15 → 2.1.17
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.
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/rum.entry.js +78 -56
- package/cjs/boot/rum.js +4 -3
- package/cjs/core/baseInfo.js +15 -1
- package/cjs/core/boundedBuffer.js +10 -6
- package/cjs/core/contextManager.js +84 -0
- package/cjs/core/dataMap.js +6 -1
- package/cjs/core/heavyCustomerDataWarning.js +31 -0
- package/cjs/core/transport.js +6 -28
- package/cjs/core/user.js +40 -0
- package/cjs/core/xhrProxy.js +13 -17
- package/cjs/helper/byteUtils.js +39 -0
- package/cjs/helper/commonContext.js +14 -0
- package/cjs/helper/jsonStringify.js +57 -0
- package/cjs/helper/tracekit.js +23 -4
- package/cjs/helper/utils.js +160 -130
- package/cjs/rumEventsCollection/assembly.js +6 -1
- package/cjs/rumEventsCollection/error/errorCollection.js +20 -24
- package/cjs/rumEventsCollection/page/index.js +3 -2
- package/cjs/rumEventsCollection/resource/resourceCollection.js +3 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/rum.entry.js +73 -55
- package/esm/boot/rum.js +4 -2
- package/esm/core/baseInfo.js +13 -1
- package/esm/core/boundedBuffer.js +9 -6
- package/esm/core/contextManager.js +70 -0
- package/esm/core/dataMap.js +4 -0
- package/esm/core/heavyCustomerDataWarning.js +19 -0
- package/esm/core/transport.js +6 -29
- package/esm/core/user.js +31 -0
- package/esm/core/xhrProxy.js +13 -17
- package/esm/helper/byteUtils.js +29 -0
- package/esm/helper/commonContext.js +7 -0
- package/esm/helper/jsonStringify.js +46 -0
- package/esm/helper/tracekit.js +22 -4
- package/esm/helper/utils.js +144 -115
- package/esm/rumEventsCollection/assembly.js +6 -1
- package/esm/rumEventsCollection/error/errorCollection.js +20 -25
- package/esm/rumEventsCollection/page/index.js +4 -3
- package/esm/rumEventsCollection/resource/resourceCollection.js +2 -1
- package/package.json +43 -43
package/esm/helper/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MpHook } from './enums';
|
|
2
|
+
import { jsonStringify } from '../helper/jsonStringify';
|
|
2
3
|
var ArrayProto = Array.prototype;
|
|
3
4
|
var ObjProto = Object.prototype;
|
|
4
5
|
var ObjProto = Object.prototype;
|
|
@@ -97,6 +98,12 @@ export var isString = function isString(obj) {
|
|
|
97
98
|
export var isDate = function isDate(obj) {
|
|
98
99
|
return toString.call(obj) === '[object Date]';
|
|
99
100
|
};
|
|
101
|
+
export var isBoolean = function isBoolean(obj) {
|
|
102
|
+
return toString.call(obj) === '[object Boolean]';
|
|
103
|
+
};
|
|
104
|
+
export var isNumber = function isNumber(obj) {
|
|
105
|
+
return toString.call(obj) === '[object Number]' && /[\d\.]+/.test(String(obj));
|
|
106
|
+
};
|
|
100
107
|
export var isFunction = function isFunction(f) {
|
|
101
108
|
if (!f) {
|
|
102
109
|
return false;
|
|
@@ -108,12 +115,6 @@ export var isFunction = function isFunction(f) {
|
|
|
108
115
|
return false;
|
|
109
116
|
}
|
|
110
117
|
};
|
|
111
|
-
export var isBoolean = function isBoolean(obj) {
|
|
112
|
-
return toString.call(obj) === '[object Boolean]';
|
|
113
|
-
};
|
|
114
|
-
export var isNumber = function isNumber(obj) {
|
|
115
|
-
return toString.call(obj) === '[object Number]' && /[\d\.]+/.test(String(obj));
|
|
116
|
-
};
|
|
117
118
|
export var isArray = nativeIsArray || function (obj) {
|
|
118
119
|
return toString.call(obj) === '[object Array]';
|
|
119
120
|
};
|
|
@@ -154,50 +155,6 @@ export function UUID(placeholder) {
|
|
|
154
155
|
return placeholder ? // tslint:disable-next-line no-bitwise
|
|
155
156
|
(parseInt(placeholder, 10) ^ Math.random() * 16 >> parseInt(placeholder, 10) / 4).toString(16) : "".concat(1e7, "-", 1e3, "-", 4e3, "-", 8e3, "-", 1e11).replace(/[018]/g, UUID);
|
|
156
157
|
}
|
|
157
|
-
export function jsonStringify(value, replacer, space) {
|
|
158
|
-
if (value === null || value === undefined) {
|
|
159
|
-
return JSON.stringify(value);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
var originalToJSON = [false, undefined];
|
|
163
|
-
|
|
164
|
-
if (hasToJSON(value)) {
|
|
165
|
-
// We need to add a flag and not rely on the truthiness of value.toJSON
|
|
166
|
-
// because it can be set but undefined and that's actually significant.
|
|
167
|
-
originalToJSON = [true, value.toJSON];
|
|
168
|
-
delete value.toJSON;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
var originalProtoToJSON = [false, undefined];
|
|
172
|
-
var prototype;
|
|
173
|
-
|
|
174
|
-
if (typeof value === 'object') {
|
|
175
|
-
prototype = Object.getPrototypeOf(value);
|
|
176
|
-
|
|
177
|
-
if (hasToJSON(prototype)) {
|
|
178
|
-
originalProtoToJSON = [true, prototype.toJSON];
|
|
179
|
-
delete prototype.toJSON;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
var result;
|
|
184
|
-
|
|
185
|
-
try {
|
|
186
|
-
result = JSON.stringify(value, undefined, space);
|
|
187
|
-
} catch (e) {
|
|
188
|
-
result = '<error: unable to serialize object>';
|
|
189
|
-
} finally {
|
|
190
|
-
if (originalToJSON[0]) {
|
|
191
|
-
value.toJSON = originalToJSON[1];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (originalProtoToJSON[0]) {
|
|
195
|
-
prototype.toJSON = originalProtoToJSON[1];
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return result;
|
|
200
|
-
}
|
|
201
158
|
export var utf8Encode = function utf8Encode(string) {
|
|
202
159
|
string = (string + '').replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
203
160
|
var utftext = '',
|
|
@@ -416,52 +373,45 @@ export var safeJSONParse = function safeJSONParse(str) {
|
|
|
416
373
|
|
|
417
374
|
return val;
|
|
418
375
|
};
|
|
419
|
-
export var now = function
|
|
376
|
+
export var now = Date.now || function () {
|
|
420
377
|
return new Date().getTime();
|
|
421
378
|
};
|
|
422
|
-
export var throttle = function throttle(
|
|
423
|
-
var
|
|
424
|
-
var
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
var
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
var throttled = function throttled() {
|
|
435
|
-
args = arguments;
|
|
436
|
-
var now = new Date().getTime();
|
|
437
|
-
if (!previous && options.leading === false) previous = now; //下次触发 func 剩余的时间
|
|
438
|
-
|
|
439
|
-
var remaining = wait - (now - previous);
|
|
440
|
-
context = this; // 如果没有剩余的时间了或者你改了系统时间
|
|
441
|
-
|
|
442
|
-
if (remaining <= 0 || remaining > wait) {
|
|
443
|
-
if (timeout) {
|
|
444
|
-
clearTimeout(timeout);
|
|
445
|
-
timeout = null;
|
|
379
|
+
export var throttle = function throttle(fn, wait, options) {
|
|
380
|
+
var needLeadingExecution = options && options.leading !== undefined ? options.leading : true;
|
|
381
|
+
var needTrailingExecution = options && options.trailing !== undefined ? options.trailing : true;
|
|
382
|
+
var inWaitPeriod = false;
|
|
383
|
+
var pendingExecutionWithParameters;
|
|
384
|
+
var pendingTimeoutId;
|
|
385
|
+
var context = this;
|
|
386
|
+
return {
|
|
387
|
+
throttled: function throttled() {
|
|
388
|
+
if (inWaitPeriod) {
|
|
389
|
+
pendingExecutionWithParameters = arguments;
|
|
390
|
+
return;
|
|
446
391
|
}
|
|
447
392
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}
|
|
393
|
+
if (needLeadingExecution) {
|
|
394
|
+
fn.apply(context, arguments);
|
|
395
|
+
} else {
|
|
396
|
+
pendingExecutionWithParameters = arguments;
|
|
397
|
+
}
|
|
454
398
|
|
|
455
|
-
|
|
456
|
-
|
|
399
|
+
inWaitPeriod = true;
|
|
400
|
+
pendingTimeoutId = setTimeout(function () {
|
|
401
|
+
if (needTrailingExecution && pendingExecutionWithParameters) {
|
|
402
|
+
fn.apply(context, pendingExecutionWithParameters);
|
|
403
|
+
}
|
|
457
404
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
405
|
+
inWaitPeriod = false;
|
|
406
|
+
pendingExecutionWithParameters = undefined;
|
|
407
|
+
}, wait);
|
|
408
|
+
},
|
|
409
|
+
cancel: function cancel() {
|
|
410
|
+
clearTimeout(pendingTimeoutId);
|
|
411
|
+
inWaitPeriod = false;
|
|
412
|
+
pendingExecutionWithParameters = undefined;
|
|
413
|
+
}
|
|
462
414
|
};
|
|
463
|
-
|
|
464
|
-
return throttled;
|
|
465
415
|
};
|
|
466
416
|
export function noop() {}
|
|
467
417
|
/**
|
|
@@ -689,31 +639,6 @@ export var deepMixObject = function deepMixObject(targetObj) {
|
|
|
689
639
|
export function getOrigin(url) {
|
|
690
640
|
return urlParse(url).getParse().Origin;
|
|
691
641
|
}
|
|
692
|
-
export function createContextManager() {
|
|
693
|
-
var context = {};
|
|
694
|
-
return {
|
|
695
|
-
get: function get() {
|
|
696
|
-
return context;
|
|
697
|
-
},
|
|
698
|
-
add: function add(key, value) {
|
|
699
|
-
if (isString(key)) {
|
|
700
|
-
context[key] = value;
|
|
701
|
-
} else {
|
|
702
|
-
console.error('key 需要传递字符串类型');
|
|
703
|
-
}
|
|
704
|
-
},
|
|
705
|
-
remove: function remove(key) {
|
|
706
|
-
delete context[key];
|
|
707
|
-
},
|
|
708
|
-
set: function set(newContext) {
|
|
709
|
-
if (isObject(newContext)) {
|
|
710
|
-
context = newContext;
|
|
711
|
-
} else {
|
|
712
|
-
console.error('content 需要传递对象类型数据');
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
};
|
|
716
|
-
}
|
|
717
642
|
export function getActivePage() {
|
|
718
643
|
var curPages = typeof getCurrentPages === 'function' ? getCurrentPages() : [];
|
|
719
644
|
|
|
@@ -727,10 +652,114 @@ export function findCommaSeparatedValue(rawString, name) {
|
|
|
727
652
|
var matches = rawString.match('(?:^|;)\\s*' + name + '\\s*=\\s*([^;]+)');
|
|
728
653
|
return matches ? matches[1] : undefined;
|
|
729
654
|
}
|
|
655
|
+
|
|
656
|
+
function createCircularReferenceChecker() {
|
|
657
|
+
if (typeof WeakSet !== 'undefined') {
|
|
658
|
+
var set = new WeakSet();
|
|
659
|
+
return {
|
|
660
|
+
hasAlreadyBeenSeen: function hasAlreadyBeenSeen(value) {
|
|
661
|
+
var has = set.has(value);
|
|
662
|
+
|
|
663
|
+
if (!has) {
|
|
664
|
+
set.add(value);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
return has;
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
var array = [];
|
|
673
|
+
return {
|
|
674
|
+
hasAlreadyBeenSeen: function hasAlreadyBeenSeen(value) {
|
|
675
|
+
var has = array.indexOf(value) >= 0;
|
|
676
|
+
|
|
677
|
+
if (!has) {
|
|
678
|
+
array.push(value);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
return has;
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Similar to `typeof`, but distinguish plain objects from `null` and arrays
|
|
687
|
+
*/
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
export function getType(value) {
|
|
691
|
+
if (value === null) {
|
|
692
|
+
return 'null';
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
if (Array.isArray(value)) {
|
|
696
|
+
return 'array';
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
return typeof value;
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Iterate over source and affect its sub values into destination, recursively.
|
|
703
|
+
* If the source and destination can't be merged, return source.
|
|
704
|
+
*/
|
|
705
|
+
|
|
706
|
+
export function mergeInto(destination, source, circularReferenceChecker) {
|
|
707
|
+
// ignore the source if it is undefined
|
|
708
|
+
if (typeof circularReferenceChecker === 'undefined') {
|
|
709
|
+
circularReferenceChecker = createCircularReferenceChecker();
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
if (source === undefined) {
|
|
713
|
+
return destination;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
if (typeof source !== 'object' || source === null) {
|
|
717
|
+
// primitive values - just return source
|
|
718
|
+
return source;
|
|
719
|
+
} else if (source instanceof Date) {
|
|
720
|
+
return new Date(source.getTime());
|
|
721
|
+
} else if (source instanceof RegExp) {
|
|
722
|
+
var flags = source.flags || // old browsers compatibility
|
|
723
|
+
[source.global ? 'g' : '', source.ignoreCase ? 'i' : '', source.multiline ? 'm' : '', source.sticky ? 'y' : '', source.unicode ? 'u' : ''].join('');
|
|
724
|
+
return new RegExp(source.source, flags);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
if (circularReferenceChecker.hasAlreadyBeenSeen(source)) {
|
|
728
|
+
// remove circular references
|
|
729
|
+
return undefined;
|
|
730
|
+
} else if (Array.isArray(source)) {
|
|
731
|
+
var merged = Array.isArray(destination) ? destination : [];
|
|
732
|
+
|
|
733
|
+
for (var i = 0; i < source.length; ++i) {
|
|
734
|
+
merged[i] = mergeInto(merged[i], source[i], circularReferenceChecker);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
return merged;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
var merged = getType(destination) === 'object' ? destination : {};
|
|
741
|
+
|
|
742
|
+
for (var key in source) {
|
|
743
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
744
|
+
merged[key] = mergeInto(merged[key], source[key], circularReferenceChecker);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
return merged;
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* A simplistic implementation of a deep clone algorithm.
|
|
752
|
+
* Caveats:
|
|
753
|
+
* - It doesn't maintain prototype chains - don't use with instances of custom classes.
|
|
754
|
+
* - It doesn't handle Map and Set
|
|
755
|
+
*/
|
|
756
|
+
|
|
757
|
+
export function deepClone(value) {
|
|
758
|
+
return mergeInto(undefined, value);
|
|
759
|
+
}
|
|
730
760
|
export var ONE_SECOND = 1000;
|
|
731
761
|
export var ONE_MINUTE = 60 * ONE_SECOND;
|
|
732
762
|
export var ONE_HOUR = 60 * ONE_MINUTE;
|
|
733
|
-
export var ONE_KILO_BYTE = 1024;
|
|
734
763
|
export function defineGlobal(global, name, api) {
|
|
735
764
|
global[name] = api;
|
|
736
765
|
}
|
|
@@ -19,6 +19,11 @@ export function startRumAssembly(applicationId, configuration, session, lifeCycl
|
|
|
19
19
|
var deviceContext = {
|
|
20
20
|
device: baseInfo.deviceInfo
|
|
21
21
|
};
|
|
22
|
+
var appContext = {
|
|
23
|
+
app: {
|
|
24
|
+
launch: baseInfo.getLaunchOptions()
|
|
25
|
+
}
|
|
26
|
+
};
|
|
22
27
|
|
|
23
28
|
if (session.isTracked() && (viewContext || rawRumEvent.type === RumEventType.APP)) {
|
|
24
29
|
var actionContext = parentContexts.findAction(startTime);
|
|
@@ -46,7 +51,7 @@ export function startRumAssembly(applicationId, configuration, session, lifeCycl
|
|
|
46
51
|
is_signin: configuration.user_id ? 'T' : 'F'
|
|
47
52
|
}
|
|
48
53
|
};
|
|
49
|
-
var rumEvent = extend2Lev(rumContext, deviceContext, viewContext, actionContext, rawRumEvent);
|
|
54
|
+
var rumEvent = extend2Lev(rumContext, deviceContext, appContext, viewContext, actionContext, rawRumEvent);
|
|
50
55
|
var serverRumEvent = withSnakeCaseKeys(rumEvent);
|
|
51
56
|
var context = extend2Lev({}, commonContext.context, customerContext);
|
|
52
57
|
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { startAutomaticErrorCollection } from '../../core/errorCollection';
|
|
2
2
|
import { RumEventType } from '../../helper/enums';
|
|
3
3
|
import { LifeCycleEventType } from '../../core/lifeCycle';
|
|
4
|
-
import {
|
|
4
|
+
import { ErrorSource, formatUnknownError } from '../../core/errorTools';
|
|
5
|
+
import { urlParse, replaceNumberCharByPath, getStatusGroup, extend2Lev, extend } from '../../helper/utils';
|
|
6
|
+
import { computeStackTrace } from '../../helper/tracekit';
|
|
5
7
|
export function startErrorCollection(lifeCycle, configuration) {
|
|
6
|
-
// return doStartErrorCollection(
|
|
7
|
-
// lifeCycle,
|
|
8
|
-
// configuration,
|
|
9
|
-
// startAutomaticErrorCollection(configuration),
|
|
10
|
-
// )
|
|
11
8
|
startAutomaticErrorCollection(configuration).subscribe(function (error) {
|
|
12
9
|
lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, {
|
|
13
10
|
error: error
|
|
@@ -20,27 +17,24 @@ export function doStartErrorCollection(lifeCycle) {
|
|
|
20
17
|
lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, processError(error.error));
|
|
21
18
|
});
|
|
22
19
|
return {
|
|
23
|
-
addError: function addError(customError, savedCommonContext) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// customerContext: customError.context,
|
|
30
|
-
// savedCommonContext: savedCommonContext,
|
|
31
|
-
// error: rawError
|
|
32
|
-
// })
|
|
20
|
+
addError: function addError(customError, savedCommonContext) {
|
|
21
|
+
var rawError = computeRawError(customError.error, customError.startTime, customError.context);
|
|
22
|
+
lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, {
|
|
23
|
+
savedCommonContext: savedCommonContext,
|
|
24
|
+
error: rawError
|
|
25
|
+
});
|
|
33
26
|
}
|
|
34
27
|
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function computeRawError(error, startTime, context) {
|
|
31
|
+
var stackTrace = error instanceof Error ? computeStackTrace(error) : undefined;
|
|
32
|
+
return extend({
|
|
33
|
+
startTime,
|
|
34
|
+
source: ErrorSource.CUSTOM,
|
|
35
|
+
context
|
|
36
|
+
}, formatUnknownError(stackTrace, error, 'Provided'));
|
|
37
|
+
}
|
|
44
38
|
|
|
45
39
|
function processError(error) {
|
|
46
40
|
var resource = error.resource;
|
|
@@ -73,6 +67,7 @@ function processError(error) {
|
|
|
73
67
|
type: RumEventType.ERROR
|
|
74
68
|
}, tracingInfo);
|
|
75
69
|
return {
|
|
70
|
+
customerContext: error.context,
|
|
76
71
|
rawRumEvent: rawRumEvent,
|
|
77
72
|
startTime: error.startTime
|
|
78
73
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { now, throttle, UUID, isNumber, getActivePage } from '../../helper/utils';
|
|
2
2
|
import { trackEventCounts } from '../trackEventCounts';
|
|
3
3
|
import { LifeCycleEventType } from '../../core/lifeCycle'; // 劫持原小程序App方法
|
|
4
4
|
|
|
@@ -87,10 +87,11 @@ function newView(lifeCycle, route, startTime) {
|
|
|
87
87
|
startTime,
|
|
88
88
|
route
|
|
89
89
|
});
|
|
90
|
-
var
|
|
90
|
+
var scheduleViewThrottled = throttle(triggerViewUpdate, THROTTLE_VIEW_UPDATE_PERIOD, {
|
|
91
91
|
leading: false
|
|
92
92
|
});
|
|
93
|
-
var
|
|
93
|
+
var scheduleViewUpdate = scheduleViewThrottled.throttled;
|
|
94
|
+
var cancelScheduleViewUpdate = scheduleViewThrottled.cancel;
|
|
94
95
|
|
|
95
96
|
var _trackEventCounts = trackEventCounts(lifeCycle, function (newEventCounts) {
|
|
96
97
|
eventCounts = newEventCounts;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { computePerformanceResourceDuration, computePerformanceResourceDetails, computeSize } from './resourceUtils';
|
|
2
2
|
import { LifeCycleEventType } from '../../core/lifeCycle';
|
|
3
|
-
import { msToNs, extend2Lev, urlParse, getQueryParamsFromUrl, replaceNumberCharByPath,
|
|
3
|
+
import { msToNs, extend2Lev, urlParse, getQueryParamsFromUrl, replaceNumberCharByPath, UUID, getStatusGroup } from '../../helper/utils';
|
|
4
|
+
import { jsonStringify } from '../../helper/jsonStringify';
|
|
4
5
|
import { RumEventType } from '../../helper/enums';
|
|
5
6
|
export function startResourceCollection(lifeCycle, configuration) {
|
|
6
7
|
lifeCycle.subscribe(LifeCycleEventType.REQUEST_COMPLETED, function (request) {
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
2
|
+
"name": "@cloudcare/rum-uniapp",
|
|
3
|
+
"version": "2.1.17",
|
|
4
|
+
"main": "cjs/index.js",
|
|
5
|
+
"module": "esm/index.js",
|
|
6
|
+
"miniprogram": "cjs",
|
|
7
|
+
"types": "cjs/index.d.ts",
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"@babel/core": "^7.12.10",
|
|
10
|
+
"@babel/preset-env": "^7.12.10",
|
|
11
|
+
"ali-oss": "^6.12.0",
|
|
12
|
+
"npm-run-all": "^4.1.5",
|
|
13
|
+
"replace-in-file": "^6.1.0",
|
|
14
|
+
"webpack": "^5.37.0",
|
|
15
|
+
"webpack-cli": "^4.7.0",
|
|
16
|
+
"webpack-dev-server": "^3.11.2"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
20
|
+
"build": "run-p build:cjs build:esm build:wx",
|
|
21
|
+
"build:watch": "webpack --watch --config ./webpack.config.js --mode=development",
|
|
22
|
+
"build:wx": "rm -rf demo/miniprogram && webpack --config webpack.config.js --mode=production && npm run replace-build-env demo/miniprogram",
|
|
23
|
+
"build:cjs": "rm -rf cjs && babel --config-file ./babel.cjs.json --out-dir cjs ./src && npm run replace-build-env cjs",
|
|
24
|
+
"build:esm": "rm -rf esm && babel --config-file ./babel.esm.json --out-dir esm ./src && npm run replace-build-env esm",
|
|
25
|
+
"publish:npm": "npm run build && node ./scripts/publish-oss.js && npm publish --access=public",
|
|
26
|
+
"publish:oss:test": "npm run build && node ./scripts/publish-oss.js test",
|
|
27
|
+
"replace-build-env": "node scripts/replace-build-env.js"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"dataflux",
|
|
31
|
+
"rum",
|
|
32
|
+
"sdk",
|
|
33
|
+
"小程序",
|
|
34
|
+
"miniapp"
|
|
35
|
+
],
|
|
36
|
+
"author": "dataflux",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"url": "https://github.com/DataFlux-cn/datakit-miniprogram-uniapp",
|
|
40
|
+
"type": "git"
|
|
41
|
+
},
|
|
42
|
+
"description": "DataFlux RUM 小程序 端数据指标监控",
|
|
43
|
+
"dependencies": {}
|
|
44
|
+
}
|