sentry-uniapp 1.0.4 → 1.0.6
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/README.md +2 -0
- package/dist/crossPlatform.d.ts +1 -5
- package/dist/crossPlatform.d.ts.map +1 -1
- package/dist/crossPlatform.js +1 -92
- package/dist/crossPlatform.js.map +1 -1
- package/dist/sentry-uniapp.min.js +2 -2
- package/dist/sentry-uniapp.min.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/esm/crossPlatform.d.ts +1 -5
- package/esm/crossPlatform.d.ts.map +1 -1
- package/esm/crossPlatform.js +1 -92
- package/esm/crossPlatform.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/esm/version.js.map +1 -1
- package/package.json +1 -1
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,QAAQ,GAAG,2BAA2B,CAAC;AACvC,QAAA,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_NAME = \"sentry.javascript.miniapp\";\nexport const SDK_VERSION = \"1.0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,QAAQ,GAAG,2BAA2B,CAAC;AACvC,QAAA,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_NAME = \"sentry.javascript.miniapp\";\nexport const SDK_VERSION = \"1.0.6\";\n"]}
|
package/esm/crossPlatform.d.ts
CHANGED
|
@@ -12,11 +12,7 @@ interface SDK {
|
|
|
12
12
|
onMemoryWarning?: Function;
|
|
13
13
|
getLaunchOptionsSync?: Function;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
* 小程序平台 接口
|
|
17
|
-
*/
|
|
18
|
-
declare type AppName = "uniapp" | "wechat" | "alipay" | "bytedance" | "dingtalk" | "qq" | "swan" | "quickapp" | "unknown";
|
|
19
15
|
declare const sdk: SDK;
|
|
20
|
-
declare const appName:
|
|
16
|
+
declare const appName: "unknown" | "uniapp" | "wechat" | "alipay" | "bytedance" | "dingtalk" | "qq" | "swan";
|
|
21
17
|
export { sdk, appName };
|
|
22
18
|
//# sourceMappingURL=crossPlatform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossPlatform.d.ts","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crossPlatform.d.ts","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,UAAU,GAAG;IACX,OAAO,EAAE,QAAQ,CAAC;IAClB,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,aAAa,EAAE,QAAQ,CAAC;IACxB,iBAAiB,EAAE,QAAQ,CAAC;IAC5B,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,oBAAoB,CAAC,EAAE,QAAQ,CAAC;IAChC,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,oBAAoB,CAAC,EAAE,QAAQ,CAAC;CACjC;AAkFD,QAAA,MAAM,GAAG,KAAW,CAAC;AACrB,QAAA,MAAM,OAAO,uFAAe,CAAC;AAE7B,OAAO,EAAC,GAAG,EAAE,OAAO,EAAC,CAAC"}
|
package/esm/crossPlatform.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { __values } from "tslib";
|
|
2
|
-
var globalCopy = global;
|
|
3
1
|
var currentSdk = {
|
|
4
2
|
// tslint:disable-next-line: no-empty
|
|
5
3
|
request: function () {
|
|
@@ -14,8 +12,6 @@ var currentSdk = {
|
|
|
14
12
|
getSystemInfo: function () {
|
|
15
13
|
},
|
|
16
14
|
};
|
|
17
|
-
// tslint:disable-next-line:no-implicit-dependencies no-var-requires
|
|
18
|
-
var fetch = require('@system.fetch');
|
|
19
15
|
/**
|
|
20
16
|
* 获取跨平台的 SDK
|
|
21
17
|
*/
|
|
@@ -41,93 +37,9 @@ var getSDK = function () {
|
|
|
41
37
|
else if (typeof swan === "object") {
|
|
42
38
|
currentSdk = swan;
|
|
43
39
|
}
|
|
44
|
-
else if (typeof fetch === 'object') {
|
|
45
|
-
// 针对快应用的兼容性封装
|
|
46
|
-
globalCopy.getCurrentPages = function () {
|
|
47
|
-
var e_1, _a;
|
|
48
|
-
// tslint:disable-next-line:no-implicit-dependencies
|
|
49
|
-
var router = require('@system.router');
|
|
50
|
-
var stacks = router.getPages();
|
|
51
|
-
var ret = [];
|
|
52
|
-
try {
|
|
53
|
-
for (var stacks_1 = __values(stacks), stacks_1_1 = stacks_1.next(); !stacks_1_1.done; stacks_1_1 = stacks_1.next()) {
|
|
54
|
-
var route = stacks_1_1.value;
|
|
55
|
-
ret.push({
|
|
56
|
-
route: route.path,
|
|
57
|
-
options: {},
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
62
|
-
finally {
|
|
63
|
-
try {
|
|
64
|
-
if (stacks_1_1 && !stacks_1_1.done && (_a = stacks_1.return)) _a.call(stacks_1);
|
|
65
|
-
}
|
|
66
|
-
finally { if (e_1) throw e_1.error; }
|
|
67
|
-
}
|
|
68
|
-
return ret;
|
|
69
|
-
};
|
|
70
|
-
currentSdk.request = fetch.fetch;
|
|
71
|
-
currentSdk.getSystemInfo = function () {
|
|
72
|
-
return new Promise(function (resolve, reject) {
|
|
73
|
-
// tslint:disable-next-line:no-implicit-dependencies
|
|
74
|
-
var app = require('@system.app');
|
|
75
|
-
var appInfo = app.getInfo();
|
|
76
|
-
// tslint:disable-next-line:no-implicit-dependencies
|
|
77
|
-
var device = require('@system.device');
|
|
78
|
-
// tslint:disable-next-line:no-implicit-dependencies
|
|
79
|
-
var battery = require('@system.battery');
|
|
80
|
-
var ret = {
|
|
81
|
-
version: appInfo.versionName,
|
|
82
|
-
battery: 0,
|
|
83
|
-
batteryLevel: 0,
|
|
84
|
-
currentBattery: 0,
|
|
85
|
-
appName: appInfo.name,
|
|
86
|
-
system: '',
|
|
87
|
-
model: String,
|
|
88
|
-
brand: String,
|
|
89
|
-
platform: String,
|
|
90
|
-
screenHeight: Number,
|
|
91
|
-
screenWidth: Number,
|
|
92
|
-
statusBarHeight: Number,
|
|
93
|
-
language: String,
|
|
94
|
-
windowWidth: Number,
|
|
95
|
-
windowHeight: Number,
|
|
96
|
-
fontSizeSetting: '',
|
|
97
|
-
};
|
|
98
|
-
device.getInfo({
|
|
99
|
-
// tslint:disable-next-line:no-shadowed-variable
|
|
100
|
-
success: function (deviceInfo) {
|
|
101
|
-
ret.language = deviceInfo.language;
|
|
102
|
-
ret.brand = deviceInfo.brand;
|
|
103
|
-
ret.model = deviceInfo.model;
|
|
104
|
-
ret.platform = deviceInfo.platformVersionName;
|
|
105
|
-
ret.screenHeight = deviceInfo.screenHeight;
|
|
106
|
-
ret.screenWidth = deviceInfo.screenWidth;
|
|
107
|
-
ret.statusBarHeight = deviceInfo.statusBarHeight;
|
|
108
|
-
ret.windowHeight = deviceInfo.windowHeight;
|
|
109
|
-
ret.windowWidth = deviceInfo.windowWidth;
|
|
110
|
-
ret.system = deviceInfo.osType + " " + deviceInfo.osVersionName;
|
|
111
|
-
battery.getStatus({
|
|
112
|
-
success: function (batteryStatus) {
|
|
113
|
-
ret.currentBattery = batteryStatus.level;
|
|
114
|
-
resolve(ret);
|
|
115
|
-
},
|
|
116
|
-
fail: function (e) {
|
|
117
|
-
reject(e);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
},
|
|
121
|
-
fail: function (e) {
|
|
122
|
-
reject(e);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
40
|
else {
|
|
129
41
|
// tslint:disable-next-line:no-console
|
|
130
|
-
console.log("sentry-uniapp
|
|
42
|
+
console.log("sentry-uniapp 暂不支持此平台, 快应用请使用 sentry-quickapp");
|
|
131
43
|
}
|
|
132
44
|
return currentSdk;
|
|
133
45
|
};
|
|
@@ -157,9 +69,6 @@ var getAppName = function () {
|
|
|
157
69
|
else if (typeof swan === "object") {
|
|
158
70
|
currentAppName = "swan";
|
|
159
71
|
}
|
|
160
|
-
else if (typeof fetch === "object") {
|
|
161
|
-
currentAppName = "quickapp";
|
|
162
|
-
}
|
|
163
72
|
return currentAppName;
|
|
164
73
|
};
|
|
165
74
|
var sdk = getSDK();
|
package/esm/crossPlatform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossPlatform.js","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crossPlatform.js","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":"AAqCA,IAAI,UAAU,GAAQ;IACpB,qCAAqC;IACrC,OAAO,EAAE;IACT,CAAC;IACD,qCAAqC;IACrC,WAAW,EAAE;IACb,CAAC;IACD,qCAAqC;IACrC,iBAAiB,EAAE;IACnB,CAAC;IACD,qCAAqC;IACrC,aAAa,EAAE;IACf,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,IAAM,MAAM,GAAG;IACb,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,UAAU,GAAG,GAAG,CAAC;KAClB;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;QACjC,UAAU,GAAG,GAAG,CAAC;KAClB;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;QACjC,UAAU,GAAG,EAAE,CAAC;KACjB;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;QACjC,UAAU,GAAG,EAAE,CAAC;KACjB;SAAM,IAAI,OAAO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序\ndeclare const tt: any; // 字节跳动小程序\ndeclare const dd: any; // 钉钉小程序\ndeclare const qq: any; // QQ 小程序、QQ 小游戏\ndeclare const swan: any; // 百度小程序\n\n/**\n * 小程序平台 SDK 接口\n */\ninterface SDK {\n request: Function;\n httpRequest?: Function; // 针对钉钉小程序\n getSystemInfo: Function;\n getSystemInfoSync: Function;\n onError?: Function;\n onUnhandledRejection?: Function;\n onPageNotFound?: Function;\n onMemoryWarning?: Function;\n getLaunchOptionsSync?: Function;\n}\n\n/**\n * 小程序平台 接口\n */\ntype AppName =\n | \"uniapp\"\n | \"wechat\"\n | \"alipay\"\n | \"bytedance\"\n | \"dingtalk\"\n | \"qq\"\n | \"swan\"\n | \"quickapp\"\n | \"unknown\";\n\nlet currentSdk: SDK = {\n // tslint:disable-next-line: no-empty\n request: () => {\n },\n // tslint:disable-next-line: no-empty\n httpRequest: () => {\n },\n // tslint:disable-next-line: no-empty\n getSystemInfoSync: () => {\n },\n // tslint:disable-next-line: no-empty\n getSystemInfo: () => {\n },\n};\n\n/**\n * 获取跨平台的 SDK\n */\nconst getSDK = () => {\n if (typeof uni === \"object\") {\n currentSdk = uni;\n } else if (typeof wx === \"object\") {\n currentSdk = uni;\n } else if (typeof my === \"object\") {\n currentSdk = my;\n } else if (typeof tt === \"object\") {\n currentSdk = tt;\n } else if (typeof dd === \"object\") {\n currentSdk = dd;\n } else if (typeof qq === \"object\") {\n currentSdk = qq;\n } else if (typeof swan === \"object\") {\n currentSdk = swan;\n } else {\n // tslint:disable-next-line:no-console\n console.log(\"sentry-uniapp 暂不支持此平台, 快应用请使用 sentry-quickapp\");\n }\n\n return currentSdk;\n};\n\n/**\n * 获取平台名称\n */\nconst getAppName = () => {\n let currentAppName: AppName = \"unknown\";\n\n if (typeof uni === \"object\") {\n currentAppName = \"uniapp\";\n } else if (typeof wx === \"object\") {\n currentAppName = \"wechat\";\n } else if (typeof my === \"object\") {\n currentAppName = \"alipay\";\n } else if (typeof tt === \"object\") {\n currentAppName = \"bytedance\";\n } else if (typeof dd === \"object\") {\n currentAppName = \"dingtalk\";\n } else if (typeof qq === \"object\") {\n currentAppName = \"qq\";\n } else if (typeof swan === \"object\") {\n currentAppName = \"swan\";\n }\n\n return currentAppName;\n};\n\nconst sdk = getSDK();\nconst appName = getAppName();\n\nexport {sdk, appName};\n"]}
|
package/esm/version.d.ts
CHANGED
package/esm/version.js
CHANGED
package/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,QAAQ,GAAG,2BAA2B,CAAC;AACpD,MAAM,CAAC,IAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_NAME = \"sentry.javascript.miniapp\";\nexport const SDK_VERSION = \"1.0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,QAAQ,GAAG,2BAA2B,CAAC;AACpD,MAAM,CAAC,IAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_NAME = \"sentry.javascript.miniapp\";\nexport const SDK_VERSION = \"1.0.6\";\n"]}
|
package/package.json
CHANGED