aegis-mp-rum-wrapper 0.1.7 → 0.1.8
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/dist/index.d.ts +0 -10
- package/dist/index.js +4 -27
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -22,15 +22,6 @@ export interface AegisUserInfo {
|
|
|
22
22
|
ext2?: string;
|
|
23
23
|
ext3?: string;
|
|
24
24
|
}
|
|
25
|
-
export interface AegisMpWrapperConfig {
|
|
26
|
-
id?: string;
|
|
27
|
-
uin?: string;
|
|
28
|
-
reportApiSpeed?: boolean;
|
|
29
|
-
reportAssetSpeed?: boolean;
|
|
30
|
-
pagePerformance?: boolean;
|
|
31
|
-
webVitals?: boolean;
|
|
32
|
-
delay?: number;
|
|
33
|
-
}
|
|
34
25
|
export interface ReportParams {
|
|
35
26
|
name: string;
|
|
36
27
|
ext1?: string;
|
|
@@ -38,7 +29,6 @@ export interface ReportParams {
|
|
|
38
29
|
ext3?: string;
|
|
39
30
|
[key: string]: any;
|
|
40
31
|
}
|
|
41
|
-
export declare function configureWrapper(config: AegisMpWrapperConfig): void;
|
|
42
32
|
export declare function setUser(user: Partial<AegisUserInfo>): void;
|
|
43
33
|
export declare function setRumID(rumID: string): void;
|
|
44
34
|
export declare function reportEvent(params: string | ReportParams): void;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AegisW = exports.GPPRumID = void 0;
|
|
7
|
-
exports.configureWrapper = configureWrapper;
|
|
8
7
|
exports.setUser = setUser;
|
|
9
8
|
exports.setRumID = setRumID;
|
|
10
9
|
exports.reportEvent = reportEvent;
|
|
@@ -144,21 +143,16 @@ function initAegis(isDefault) {
|
|
|
144
143
|
ext3: internalState.user.ext3,
|
|
145
144
|
}, true);
|
|
146
145
|
}
|
|
147
|
-
console.log("
|
|
146
|
+
console.log("Aegis235", aegis_mp_sdk_1.default);
|
|
148
147
|
// 小程序环境直接使用构造函数
|
|
149
148
|
if (typeof aegis_mp_sdk_1.default === "function") {
|
|
150
|
-
console.log("return new
|
|
149
|
+
console.log("return new Aegis");
|
|
151
150
|
return new aegis_mp_sdk_1.default({
|
|
152
|
-
id,
|
|
151
|
+
id: '8lDwXIovanY8d1awa6',
|
|
153
152
|
uin: internalState.uin,
|
|
154
|
-
reportApiSpeed: apiSpeed,
|
|
155
|
-
reportAssetSpeed: assetSpeed,
|
|
156
|
-
pagePerformance,
|
|
157
|
-
webVitals,
|
|
158
|
-
delay,
|
|
159
153
|
spa: true,
|
|
160
154
|
ext1,
|
|
161
|
-
|
|
155
|
+
hostUrl: "https://aegis.qq.com",
|
|
162
156
|
beforeRequest(data) {
|
|
163
157
|
if (data.logType === "speed" || data.logType === "log") {
|
|
164
158
|
return false;
|
|
@@ -170,23 +164,6 @@ function initAegis(isDefault) {
|
|
|
170
164
|
console.error("[Aegis Wrapper] 找不到 aegis-mp-sdk 构造函数,请确认依赖是否正确安装和引用265");
|
|
171
165
|
return undefined;
|
|
172
166
|
}
|
|
173
|
-
// 对外暴露的配置 API
|
|
174
|
-
function configureWrapper(config) {
|
|
175
|
-
if (config.id)
|
|
176
|
-
internalState.id = config.id;
|
|
177
|
-
if (typeof config.uin === "string")
|
|
178
|
-
internalState.uin = config.uin;
|
|
179
|
-
if (typeof config.reportApiSpeed === "boolean")
|
|
180
|
-
internalState.reportApiSpeed = config.reportApiSpeed;
|
|
181
|
-
if (typeof config.reportAssetSpeed === "boolean")
|
|
182
|
-
internalState.reportAssetSpeed = config.reportAssetSpeed;
|
|
183
|
-
if (typeof config.pagePerformance === "boolean")
|
|
184
|
-
internalState.pagePerformance = config.pagePerformance;
|
|
185
|
-
if (typeof config.webVitals === "boolean")
|
|
186
|
-
internalState.webVitals = config.webVitals;
|
|
187
|
-
if (typeof config.delay === "number")
|
|
188
|
-
internalState.delay = config.delay;
|
|
189
|
-
}
|
|
190
167
|
function setUser(user) {
|
|
191
168
|
const incoming = user;
|
|
192
169
|
const nextUser = Object.assign(Object.assign({}, internalState.user), user);
|