sentry-uniapp 1.0.12 → 2.8.1

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.
Files changed (375) hide show
  1. package/README.md +11 -9
  2. package/dist/client.d.ts +42 -40
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +62 -41
  5. package/dist/client.js.map +1 -1
  6. package/dist/crossPlatform.d.ts +1 -1
  7. package/dist/crossPlatform.d.ts.map +1 -1
  8. package/dist/crossPlatform.js +26 -10
  9. package/dist/crossPlatform.js.map +1 -1
  10. package/dist/debug.d.ts +4 -0
  11. package/dist/debug.d.ts.map +1 -0
  12. package/dist/debug.js +23 -0
  13. package/dist/debug.js.map +1 -0
  14. package/dist/eventbuilder.d.ts +9 -10
  15. package/dist/eventbuilder.d.ts.map +1 -1
  16. package/dist/eventbuilder.js +131 -58
  17. package/dist/eventbuilder.js.map +1 -1
  18. package/dist/flags.js +1 -0
  19. package/dist/flags.js.map +1 -1
  20. package/dist/index.d.ts +10 -9
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +84 -21
  23. package/dist/index.js.map +1 -1
  24. package/dist/integrations/globalhandlers.d.ts +10 -44
  25. package/dist/integrations/globalhandlers.d.ts.map +1 -1
  26. package/dist/integrations/globalhandlers.js +101 -134
  27. package/dist/integrations/globalhandlers.js.map +1 -1
  28. package/dist/integrations/ignoreMpcrawlerErrors.d.ts +3 -18
  29. package/dist/integrations/ignoreMpcrawlerErrors.d.ts.map +1 -1
  30. package/dist/integrations/ignoreMpcrawlerErrors.js +28 -28
  31. package/dist/integrations/ignoreMpcrawlerErrors.js.map +1 -1
  32. package/dist/integrations/index.d.ts +4 -6
  33. package/dist/integrations/index.d.ts.map +1 -1
  34. package/dist/integrations/index.js +12 -10
  35. package/dist/integrations/index.js.map +1 -1
  36. package/dist/integrations/router.d.ts +6 -24
  37. package/dist/integrations/router.d.ts.map +1 -1
  38. package/dist/integrations/router.js +39 -42
  39. package/dist/integrations/router.js.map +1 -1
  40. package/dist/integrations/system.d.ts +5 -16
  41. package/dist/integrations/system.d.ts.map +1 -1
  42. package/dist/integrations/system.js +62 -60
  43. package/dist/integrations/system.js.map +1 -1
  44. package/dist/parsers.d.ts +2 -2
  45. package/dist/parsers.d.ts.map +1 -1
  46. package/dist/parsers.js +27 -26
  47. package/dist/parsers.js.map +1 -1
  48. package/dist/polyfills.d.ts +5 -0
  49. package/dist/polyfills.d.ts.map +1 -0
  50. package/dist/polyfills.js +100 -0
  51. package/dist/polyfills.js.map +1 -0
  52. package/dist/sdk.d.ts +10 -85
  53. package/dist/sdk.d.ts.map +1 -1
  54. package/dist/sdk.js +69 -127
  55. package/dist/sdk.js.map +1 -1
  56. package/dist/tracekit.js +35 -33
  57. package/dist/tracekit.js.map +1 -1
  58. package/dist/transport.d.ts +7 -0
  59. package/dist/transport.d.ts.map +1 -0
  60. package/dist/transport.js +75 -0
  61. package/dist/transport.js.map +1 -0
  62. package/dist/transports/index.d.ts +1 -2
  63. package/dist/transports/index.d.ts.map +1 -1
  64. package/dist/transports/index.js +4 -4
  65. package/dist/transports/index.js.map +1 -1
  66. package/dist/version.d.ts +1 -1
  67. package/dist/version.d.ts.map +1 -1
  68. package/dist/version.js +2 -2
  69. package/dist/version.js.map +1 -1
  70. package/esm/client.d.ts +42 -40
  71. package/esm/client.d.ts.map +1 -1
  72. package/esm/client.js +59 -40
  73. package/esm/client.js.map +1 -1
  74. package/esm/crossPlatform.d.ts +1 -1
  75. package/esm/crossPlatform.d.ts.map +1 -1
  76. package/esm/crossPlatform.js +25 -10
  77. package/esm/crossPlatform.js.map +1 -1
  78. package/esm/debug.d.ts +4 -0
  79. package/esm/debug.d.ts.map +1 -0
  80. package/esm/debug.js +18 -0
  81. package/esm/debug.js.map +1 -0
  82. package/esm/eventbuilder.d.ts +9 -10
  83. package/esm/eventbuilder.d.ts.map +1 -1
  84. package/esm/eventbuilder.js +125 -52
  85. package/esm/eventbuilder.js.map +1 -1
  86. package/esm/flags.js +1 -1
  87. package/esm/flags.js.map +1 -1
  88. package/esm/index.d.ts +10 -9
  89. package/esm/index.d.ts.map +1 -1
  90. package/esm/index.js +13 -8
  91. package/esm/index.js.map +1 -1
  92. package/esm/integrations/globalhandlers.d.ts +10 -44
  93. package/esm/integrations/globalhandlers.d.ts.map +1 -1
  94. package/esm/integrations/globalhandlers.js +99 -133
  95. package/esm/integrations/globalhandlers.js.map +1 -1
  96. package/esm/integrations/ignoreMpcrawlerErrors.d.ts +3 -18
  97. package/esm/integrations/ignoreMpcrawlerErrors.d.ts.map +1 -1
  98. package/esm/integrations/ignoreMpcrawlerErrors.js +25 -26
  99. package/esm/integrations/ignoreMpcrawlerErrors.js.map +1 -1
  100. package/esm/integrations/index.d.ts +4 -6
  101. package/esm/integrations/index.d.ts.map +1 -1
  102. package/esm/integrations/index.js +5 -6
  103. package/esm/integrations/index.js.map +1 -1
  104. package/esm/integrations/router.d.ts +6 -24
  105. package/esm/integrations/router.d.ts.map +1 -1
  106. package/esm/integrations/router.js +37 -41
  107. package/esm/integrations/router.js.map +1 -1
  108. package/esm/integrations/system.d.ts +5 -16
  109. package/esm/integrations/system.d.ts.map +1 -1
  110. package/esm/integrations/system.js +60 -59
  111. package/esm/integrations/system.js.map +1 -1
  112. package/esm/parsers.d.ts +2 -2
  113. package/esm/parsers.d.ts.map +1 -1
  114. package/esm/parsers.js +20 -19
  115. package/esm/parsers.js.map +1 -1
  116. package/esm/polyfills.d.ts +5 -0
  117. package/esm/polyfills.d.ts.map +1 -0
  118. package/esm/polyfills.js +100 -0
  119. package/esm/polyfills.js.map +1 -0
  120. package/esm/sdk.d.ts +10 -85
  121. package/esm/sdk.d.ts.map +1 -1
  122. package/esm/sdk.js +63 -120
  123. package/esm/sdk.js.map +1 -1
  124. package/esm/tracekit.js +33 -31
  125. package/esm/tracekit.js.map +1 -1
  126. package/esm/transport.d.ts +7 -0
  127. package/esm/transport.d.ts.map +1 -0
  128. package/esm/transport.js +71 -0
  129. package/esm/transport.js.map +1 -0
  130. package/esm/transports/index.d.ts +1 -2
  131. package/esm/transports/index.d.ts.map +1 -1
  132. package/esm/transports/index.js +1 -2
  133. package/esm/transports/index.js.map +1 -1
  134. package/esm/version.d.ts +1 -1
  135. package/esm/version.d.ts.map +1 -1
  136. package/esm/version.js +2 -3
  137. package/esm/version.js.map +1 -1
  138. package/package.json +23 -27
  139. package/dist/backend.d.ts +0 -41
  140. package/dist/backend.d.ts.map +0 -1
  141. package/dist/backend.js +0 -68
  142. package/dist/backend.js.map +0 -1
  143. package/dist/helpers.d.ts +0 -35
  144. package/dist/helpers.d.ts.map +0 -1
  145. package/dist/helpers.js +0 -236
  146. package/dist/helpers.js.map +0 -1
  147. package/dist/integrations/linkederrors.d.ts +0 -40
  148. package/dist/integrations/linkederrors.d.ts.map +0 -1
  149. package/dist/integrations/linkederrors.js +0 -65
  150. package/dist/integrations/linkederrors.js.map +0 -1
  151. package/dist/integrations/trycatch.d.ts +0 -26
  152. package/dist/integrations/trycatch.d.ts.map +0 -1
  153. package/dist/integrations/trycatch.js +0 -166
  154. package/dist/integrations/trycatch.js.map +0 -1
  155. package/dist/package.json +0 -52
  156. package/dist/sentry-uniapp.min.js +0 -3
  157. package/dist/sentry-uniapp.min.js.LICENSE.txt +0 -14
  158. package/dist/sentry-uniapp.min.js.map +0 -1
  159. package/dist/src/backend.d.ts +0 -41
  160. package/dist/src/backend.d.ts.map +0 -1
  161. package/dist/src/backend.js +0 -68
  162. package/dist/src/backend.js.map +0 -1
  163. package/dist/src/client.d.ts +0 -55
  164. package/dist/src/client.d.ts.map +0 -1
  165. package/dist/src/client.js +0 -51
  166. package/dist/src/client.js.map +0 -1
  167. package/dist/src/crossPlatform.d.ts +0 -18
  168. package/dist/src/crossPlatform.d.ts.map +0 -1
  169. package/dist/src/crossPlatform.js +0 -80
  170. package/dist/src/crossPlatform.js.map +0 -1
  171. package/dist/src/eventbuilder.d.ts +0 -11
  172. package/dist/src/eventbuilder.d.ts.map +0 -1
  173. package/dist/src/eventbuilder.js +0 -79
  174. package/dist/src/eventbuilder.js.map +0 -1
  175. package/dist/src/flags.d.ts +0 -3
  176. package/dist/src/flags.d.ts.map +0 -1
  177. package/dist/src/flags.js +0 -18
  178. package/dist/src/flags.js.map +0 -1
  179. package/dist/src/helpers.d.ts +0 -35
  180. package/dist/src/helpers.d.ts.map +0 -1
  181. package/dist/src/helpers.js +0 -236
  182. package/dist/src/helpers.js.map +0 -1
  183. package/dist/src/index.d.ts +0 -10
  184. package/dist/src/index.d.ts.map +0 -1
  185. package/dist/src/index.js +0 -40
  186. package/dist/src/index.js.map +0 -1
  187. package/dist/src/integrations/globalhandlers.d.ts +0 -47
  188. package/dist/src/integrations/globalhandlers.d.ts.map +0 -1
  189. package/dist/src/integrations/globalhandlers.js +0 -153
  190. package/dist/src/integrations/globalhandlers.js.map +0 -1
  191. package/dist/src/integrations/ignoreMpcrawlerErrors.d.ts +0 -21
  192. package/dist/src/integrations/ignoreMpcrawlerErrors.d.ts.map +0 -1
  193. package/dist/src/integrations/ignoreMpcrawlerErrors.js +0 -40
  194. package/dist/src/integrations/ignoreMpcrawlerErrors.js.map +0 -1
  195. package/dist/src/integrations/index.d.ts +0 -7
  196. package/dist/src/integrations/index.d.ts.map +0 -1
  197. package/dist/src/integrations/index.js +0 -14
  198. package/dist/src/integrations/index.js.map +0 -1
  199. package/dist/src/integrations/linkederrors.d.ts +0 -40
  200. package/dist/src/integrations/linkederrors.d.ts.map +0 -1
  201. package/dist/src/integrations/linkederrors.js +0 -65
  202. package/dist/src/integrations/linkederrors.js.map +0 -1
  203. package/dist/src/integrations/router.d.ts +0 -28
  204. package/dist/src/integrations/router.d.ts.map +0 -1
  205. package/dist/src/integrations/router.js +0 -47
  206. package/dist/src/integrations/router.js.map +0 -1
  207. package/dist/src/integrations/system.d.ts +0 -17
  208. package/dist/src/integrations/system.d.ts.map +0 -1
  209. package/dist/src/integrations/system.js +0 -65
  210. package/dist/src/integrations/system.js.map +0 -1
  211. package/dist/src/integrations/trycatch.d.ts +0 -26
  212. package/dist/src/integrations/trycatch.d.ts.map +0 -1
  213. package/dist/src/integrations/trycatch.js +0 -166
  214. package/dist/src/integrations/trycatch.js.map +0 -1
  215. package/dist/src/parsers.d.ts +0 -21
  216. package/dist/src/parsers.d.ts.map +0 -1
  217. package/dist/src/parsers.js +0 -97
  218. package/dist/src/parsers.js.map +0 -1
  219. package/dist/src/sdk.d.ts +0 -99
  220. package/dist/src/sdk.d.ts.map +0 -1
  221. package/dist/src/sdk.js +0 -155
  222. package/dist/src/sdk.js.map +0 -1
  223. package/dist/src/tracekit.d.ts +0 -38
  224. package/dist/src/tracekit.d.ts.map +0 -1
  225. package/dist/src/tracekit.js +0 -222
  226. package/dist/src/tracekit.js.map +0 -1
  227. package/dist/src/transports/base.d.ts +0 -22
  228. package/dist/src/transports/base.d.ts.map +0 -1
  229. package/dist/src/transports/base.js +0 -28
  230. package/dist/src/transports/base.js.map +0 -1
  231. package/dist/src/transports/index.d.ts +0 -3
  232. package/dist/src/transports/index.d.ts.map +0 -1
  233. package/dist/src/transports/index.js +0 -6
  234. package/dist/src/transports/index.js.map +0 -1
  235. package/dist/src/transports/xhr.d.ts +0 -10
  236. package/dist/src/transports/xhr.d.ts.map +0 -1
  237. package/dist/src/transports/xhr.js +0 -42
  238. package/dist/src/transports/xhr.js.map +0 -1
  239. package/dist/src/version.d.ts +0 -3
  240. package/dist/src/version.d.ts.map +0 -1
  241. package/dist/src/version.js +0 -6
  242. package/dist/src/version.js.map +0 -1
  243. package/dist/transports/base.d.ts +0 -22
  244. package/dist/transports/base.d.ts.map +0 -1
  245. package/dist/transports/base.js +0 -28
  246. package/dist/transports/base.js.map +0 -1
  247. package/dist/transports/xhr.d.ts +0 -10
  248. package/dist/transports/xhr.d.ts.map +0 -1
  249. package/dist/transports/xhr.js +0 -42
  250. package/dist/transports/xhr.js.map +0 -1
  251. package/dist/utils/debug-build.d.ts +0 -7
  252. package/dist/utils/debug-build.d.ts.map +0 -1
  253. package/dist/utils/debug-build.js +0 -9
  254. package/dist/utils/debug-build.js.map +0 -1
  255. package/dist/utils/logger.d.ts +0 -16
  256. package/dist/utils/logger.d.ts.map +0 -1
  257. package/dist/utils/logger.js +0 -50
  258. package/dist/utils/logger.js.map +0 -1
  259. package/esm/backend.d.ts +0 -41
  260. package/esm/backend.d.ts.map +0 -1
  261. package/esm/backend.js +0 -66
  262. package/esm/backend.js.map +0 -1
  263. package/esm/helpers.d.ts +0 -35
  264. package/esm/helpers.d.ts.map +0 -1
  265. package/esm/helpers.js +0 -229
  266. package/esm/helpers.js.map +0 -1
  267. package/esm/integrations/linkederrors.d.ts +0 -40
  268. package/esm/integrations/linkederrors.d.ts.map +0 -1
  269. package/esm/integrations/linkederrors.js +0 -63
  270. package/esm/integrations/linkederrors.js.map +0 -1
  271. package/esm/integrations/trycatch.d.ts +0 -26
  272. package/esm/integrations/trycatch.d.ts.map +0 -1
  273. package/esm/integrations/trycatch.js +0 -164
  274. package/esm/integrations/trycatch.js.map +0 -1
  275. package/esm/package.json +0 -52
  276. package/esm/src/backend.d.ts +0 -41
  277. package/esm/src/backend.d.ts.map +0 -1
  278. package/esm/src/backend.js +0 -66
  279. package/esm/src/backend.js.map +0 -1
  280. package/esm/src/client.d.ts +0 -55
  281. package/esm/src/client.d.ts.map +0 -1
  282. package/esm/src/client.js +0 -49
  283. package/esm/src/client.js.map +0 -1
  284. package/esm/src/crossPlatform.d.ts +0 -18
  285. package/esm/src/crossPlatform.d.ts.map +0 -1
  286. package/esm/src/crossPlatform.js +0 -77
  287. package/esm/src/crossPlatform.js.map +0 -1
  288. package/esm/src/eventbuilder.d.ts +0 -11
  289. package/esm/src/eventbuilder.d.ts.map +0 -1
  290. package/esm/src/eventbuilder.js +0 -75
  291. package/esm/src/eventbuilder.js.map +0 -1
  292. package/esm/src/flags.d.ts +0 -3
  293. package/esm/src/flags.d.ts.map +0 -1
  294. package/esm/src/flags.js +0 -16
  295. package/esm/src/flags.js.map +0 -1
  296. package/esm/src/helpers.d.ts +0 -35
  297. package/esm/src/helpers.d.ts.map +0 -1
  298. package/esm/src/helpers.js +0 -229
  299. package/esm/src/helpers.js.map +0 -1
  300. package/esm/src/index.d.ts +0 -10
  301. package/esm/src/index.d.ts.map +0 -1
  302. package/esm/src/index.js +0 -9
  303. package/esm/src/index.js.map +0 -1
  304. package/esm/src/integrations/globalhandlers.d.ts +0 -47
  305. package/esm/src/integrations/globalhandlers.d.ts.map +0 -1
  306. package/esm/src/integrations/globalhandlers.js +0 -151
  307. package/esm/src/integrations/globalhandlers.js.map +0 -1
  308. package/esm/src/integrations/ignoreMpcrawlerErrors.d.ts +0 -21
  309. package/esm/src/integrations/ignoreMpcrawlerErrors.d.ts.map +0 -1
  310. package/esm/src/integrations/ignoreMpcrawlerErrors.js +0 -38
  311. package/esm/src/integrations/ignoreMpcrawlerErrors.js.map +0 -1
  312. package/esm/src/integrations/index.d.ts +0 -7
  313. package/esm/src/integrations/index.d.ts.map +0 -1
  314. package/esm/src/integrations/index.js +0 -7
  315. package/esm/src/integrations/index.js.map +0 -1
  316. package/esm/src/integrations/linkederrors.d.ts +0 -40
  317. package/esm/src/integrations/linkederrors.d.ts.map +0 -1
  318. package/esm/src/integrations/linkederrors.js +0 -63
  319. package/esm/src/integrations/linkederrors.js.map +0 -1
  320. package/esm/src/integrations/router.d.ts +0 -28
  321. package/esm/src/integrations/router.d.ts.map +0 -1
  322. package/esm/src/integrations/router.js +0 -45
  323. package/esm/src/integrations/router.js.map +0 -1
  324. package/esm/src/integrations/system.d.ts +0 -17
  325. package/esm/src/integrations/system.d.ts.map +0 -1
  326. package/esm/src/integrations/system.js +0 -63
  327. package/esm/src/integrations/system.js.map +0 -1
  328. package/esm/src/integrations/trycatch.d.ts +0 -26
  329. package/esm/src/integrations/trycatch.d.ts.map +0 -1
  330. package/esm/src/integrations/trycatch.js +0 -164
  331. package/esm/src/integrations/trycatch.js.map +0 -1
  332. package/esm/src/parsers.d.ts +0 -21
  333. package/esm/src/parsers.d.ts.map +0 -1
  334. package/esm/src/parsers.js +0 -91
  335. package/esm/src/parsers.js.map +0 -1
  336. package/esm/src/sdk.d.ts +0 -99
  337. package/esm/src/sdk.d.ts.map +0 -1
  338. package/esm/src/sdk.js +0 -147
  339. package/esm/src/sdk.js.map +0 -1
  340. package/esm/src/tracekit.d.ts +0 -38
  341. package/esm/src/tracekit.d.ts.map +0 -1
  342. package/esm/src/tracekit.js +0 -219
  343. package/esm/src/tracekit.js.map +0 -1
  344. package/esm/src/transports/base.d.ts +0 -22
  345. package/esm/src/transports/base.d.ts.map +0 -1
  346. package/esm/src/transports/base.js +0 -26
  347. package/esm/src/transports/base.js.map +0 -1
  348. package/esm/src/transports/index.d.ts +0 -3
  349. package/esm/src/transports/index.d.ts.map +0 -1
  350. package/esm/src/transports/index.js +0 -3
  351. package/esm/src/transports/index.js.map +0 -1
  352. package/esm/src/transports/xhr.d.ts +0 -10
  353. package/esm/src/transports/xhr.d.ts.map +0 -1
  354. package/esm/src/transports/xhr.js +0 -40
  355. package/esm/src/transports/xhr.js.map +0 -1
  356. package/esm/src/version.d.ts +0 -3
  357. package/esm/src/version.d.ts.map +0 -1
  358. package/esm/src/version.js +0 -4
  359. package/esm/src/version.js.map +0 -1
  360. package/esm/transports/base.d.ts +0 -22
  361. package/esm/transports/base.d.ts.map +0 -1
  362. package/esm/transports/base.js +0 -26
  363. package/esm/transports/base.js.map +0 -1
  364. package/esm/transports/xhr.d.ts +0 -10
  365. package/esm/transports/xhr.d.ts.map +0 -1
  366. package/esm/transports/xhr.js +0 -40
  367. package/esm/transports/xhr.js.map +0 -1
  368. package/esm/utils/debug-build.d.ts +0 -7
  369. package/esm/utils/debug-build.d.ts.map +0 -1
  370. package/esm/utils/debug-build.js +0 -7
  371. package/esm/utils/debug-build.js.map +0 -1
  372. package/esm/utils/logger.d.ts +0 -25
  373. package/esm/utils/logger.d.ts.map +0 -1
  374. package/esm/utils/logger.js +0 -42
  375. package/esm/utils/logger.js.map +0 -1
package/README.md CHANGED
@@ -12,13 +12,13 @@
12
12
 
13
13
  ## 用法
14
14
 
15
- 1. 安装依赖
15
+ 1、安装依赖
16
16
 
17
- ```bash
18
- npm install sentry-uniapp
19
- ```
17
+ ```bash
18
+ npm install sentry-uniapp
19
+ ```
20
20
 
21
- 2. `App.vue => onLaunch` 中初始化
21
+ 2、在 `App.vue => onLaunch` 中初始化
22
22
 
23
23
  注意替换下方代码里的 `__DSN__`,并仔细阅读注释说明和常见问题
24
24
 
@@ -31,7 +31,7 @@ export default {
31
31
  dsn: '__DSN__',
32
32
 
33
33
  // extraOptions 主要是解决平台差异问题的,见下方说明
34
- // 非 APP 平台,可以不实用
34
+ // 非 APP 平台,可以不用
35
35
  extraOptions: { onmemorywarning: false, onerror: false }
36
36
  });
37
37
 
@@ -58,7 +58,7 @@ export default {
58
58
  }
59
59
  ```
60
60
 
61
- ***其他可选配置***
61
+ 3、其他可选配置
62
62
 
63
63
  ```js
64
64
  // Set user information, as well as tags and further extras
@@ -94,7 +94,7 @@ export default {
94
94
 
95
95
  ## 参考示例
96
96
 
97
- 项目代码里的 `uapp-demo`,通过 HBuilderX 打开即可
97
+ 项目代码里的 `uapp-demo`,通过 HBuilderX 打开即可,下面截图为 `uapp-demo` 在各平台测试结果。
98
98
 
99
99
  ![pass](./assets/sentry-screetshot.png)
100
100
 
@@ -173,6 +173,8 @@ Vue 层报的错误,可以触发 sentry 上报,错误信息如下:
173
173
 
174
174
  微信: yinqisen
175
175
 
176
- 推荐另一个开源作品 `uapp`, 方便 Uniapp 离线打包的 cli。
176
+ 推荐另一个开源作品 `uapp`, 方便 Uniapp 离线打包的 cli。
177
+
178
+ <https://github.com/uappkit/uapp>
177
179
 
178
180
  ![uapp](./uapp-demo/static/logo.png)
package/dist/client.d.ts CHANGED
@@ -1,55 +1,57 @@
1
- import { BaseClient, Scope } from "@sentry/core";
2
- import { DsnLike, Event, EventHint } from "@sentry/types";
3
- import { MiniappBackend, MiniappOptions } from "./backend";
1
+ import { BaseClient } from '@sentry/core';
2
+ import type { ClientOptions, Event, EventHint, Scope, SeverityLevel } from '@sentry/core';
4
3
  /**
5
- * All properties the report dialog supports
4
+ * Configuration options for the Uniapp SDK.
6
5
  */
7
- export interface ReportDialogOptions {
8
- [key: string]: any;
9
- eventId?: string;
10
- dsn?: DsnLike;
11
- user?: {
12
- email?: string;
13
- name?: string;
6
+ export interface UniappOptions extends ClientOptions {
7
+ /**
8
+ * List of URLs to allow for error tracking.
9
+ */
10
+ allowUrls?: Array<string | RegExp>;
11
+ /**
12
+ * List of URLs to deny for error tracking.
13
+ */
14
+ denyUrls?: Array<string | RegExp>;
15
+ /**
16
+ * Extra options for global handlers integration
17
+ */
18
+ extraOptions?: {
19
+ onerror?: boolean;
20
+ onunhandledrejection?: boolean;
21
+ onpagenotfound?: boolean;
22
+ onmemorywarning?: boolean;
14
23
  };
15
- lang?: string;
16
- title?: string;
17
- subtitle?: string;
18
- subtitle2?: string;
19
- labelName?: string;
20
- labelEmail?: string;
21
- labelComments?: string;
22
- labelClose?: string;
23
- labelSubmit?: string;
24
- errorGeneric?: string;
25
- errorFormEntry?: string;
26
- successMessage?: string;
27
- /** Callback after reportDialog showed up */
28
- onLoad?(): void;
24
+ /**
25
+ * Enable debug logging
26
+ */
27
+ debug?: boolean;
29
28
  }
30
29
  /**
31
- * The Sentry Miniapp SDK Client.
32
- *
33
- * @see MiniappOptions for documentation on configuration options.
34
- * @see SentryClient for usage documentation.
30
+ * The Sentry Uniapp SDK Client.
35
31
  */
36
- export declare class MiniappClient extends BaseClient<MiniappBackend, MiniappOptions> {
32
+ export declare class UniappClient extends BaseClient<UniappOptions> {
37
33
  /**
38
- * Creates a new Miniapp SDK instance.
39
- *
40
- * @param options Configuration options for this SDK.
34
+ * Creates a new Uniapp SDK instance.
41
35
  */
42
- constructor(options?: MiniappOptions);
36
+ constructor(options: UniappOptions);
43
37
  /**
44
38
  * @inheritDoc
45
39
  */
46
- protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike<Event | null>;
40
+ protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null>;
41
+ /**
42
+ * Create an event from an exception.
43
+ */
44
+ eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;
47
45
  /**
48
- * Show a report dialog to the user to send feedback to a specific event.
49
- * 向用户显示报告对话框以将反馈发送到特定事件。---> 小程序上暂时用不到&不考虑。
50
- *
51
- * @param options Set individual options for the dialog
46
+ * Create an event from a message.
52
47
  */
53
- showReportDialog(options?: ReportDialogOptions): void;
48
+ eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event>;
49
+ }
50
+ /**
51
+ * Options for showing the report dialog (not supported in miniapp environment)
52
+ */
53
+ export interface ReportDialogOptions {
54
+ eventId?: string;
55
+ [key: string]: any;
54
56
  }
55
57
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB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AO,CAAC;QAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;IAEF;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,UAAU,CAAC,aAAa,CAAC;IACzD;;OAEG;gBACgB,OAAO,EAAE,aAAa;IAsBzC;;OAEG;IACH,SAAS,CAAC,aAAa,CACrB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,KAAK,GACZ,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;IAoB5B;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAI/E;;OAEG;IACI,gBAAgB,CACrB,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,aAAsB,EAC7B,IAAI,CAAC,EAAE,SAAS,GACf,WAAW,CAAC,KAAK,CAAC;CAGtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
package/dist/client.js CHANGED
@@ -1,54 +1,75 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.MiniappClient = void 0;
3
- var tslib_1 = require("tslib");
4
- var core_1 = require("@sentry/core");
5
- var backend_1 = require("./backend");
6
- var version_1 = require("./version");
3
+ exports.UniappClient = void 0;
4
+ // logger is not exported from core in v8, stays in utils or needs check
5
+ // But based on user request, let's check other files.
6
+ // Actually, logger IS internal in v8 usually. Let's keep it if not deprecated or check specifically.
7
+ // User specifically mentioned extractExceptionKeysForMessage, isEvent, normalizeToSize.
8
+ // Let's stick to those for now, and check if logger is deprecated.
9
+ const core_1 = require("@sentry/core");
10
+ const eventbuilder_1 = require("./eventbuilder");
11
+ const transport_1 = require("./transport");
12
+ const version_1 = require("./version");
13
+ const debug_1 = require("./debug");
7
14
  /**
8
- * The Sentry Miniapp SDK Client.
9
- *
10
- * @see MiniappOptions for documentation on configuration options.
11
- * @see SentryClient for usage documentation.
15
+ * The Sentry Uniapp SDK Client.
12
16
  */
13
- var MiniappClient = /** @class */ (function (_super) {
14
- tslib_1.__extends(MiniappClient, _super);
17
+ class UniappClient extends core_1.BaseClient {
15
18
  /**
16
- * Creates a new Miniapp SDK instance.
17
- *
18
- * @param options Configuration options for this SDK.
19
+ * Creates a new Uniapp SDK instance.
19
20
  */
20
- function MiniappClient(options) {
21
- if (options === void 0) { options = {}; }
22
- return _super.call(this, backend_1.MiniappBackend, options) || this;
21
+ constructor(options) {
22
+ (0, debug_1.debugLog)('[Sentry Client] Constructor called');
23
+ (0, debug_1.debugLog)('[Sentry Client] options.dsn:', options.dsn);
24
+ (0, debug_1.debugLog)('[Sentry Client] options.transport:', typeof options.transport);
25
+ // Set default transport if not provided
26
+ const clientOptions = {
27
+ transport: transport_1.makeUniappTransport,
28
+ ...options,
29
+ };
30
+ (0, debug_1.debugLog)('[Sentry Client] Calling super(options)...');
31
+ try {
32
+ super(clientOptions);
33
+ (0, debug_1.debugLog)('[Sentry Client] super() completed successfully!');
34
+ }
35
+ catch (error) {
36
+ (0, debug_1.debugError)('[Sentry Client] super() threw error:', error);
37
+ throw error;
38
+ }
39
+ (0, debug_1.debugLog)('[Sentry Client] Constructor complete');
23
40
  }
24
41
  /**
25
42
  * @inheritDoc
26
43
  */
27
- MiniappClient.prototype._prepareEvent = function (event, scope, hint) {
28
- event.platform = event.platform || "javascript";
29
- event.sdk = tslib_1.__assign(tslib_1.__assign({}, event.sdk), { name: version_1.SDK_NAME, packages: tslib_1.__spread(((event.sdk && event.sdk.packages) || []), [
44
+ _prepareEvent(event, hint, scope) {
45
+ (0, debug_1.debugLog)('[Sentry Client] _prepareEvent called for event:', event.event_id);
46
+ (0, debug_1.debugLog)('[Sentry Client] Event type:', event.type);
47
+ (0, debug_1.debugLog)('[Sentry Client] Event message:', event.message);
48
+ // Set SDK info
49
+ event.sdk = {
50
+ name: version_1.SDK_NAME,
51
+ packages: [
30
52
  {
31
- name: "npm:sentry-uniapp",
32
- version: version_1.SDK_VERSION
33
- }
34
- ]), version: version_1.SDK_VERSION });
35
- return _super.prototype._prepareEvent.call(this, event, scope, hint);
36
- };
37
- // protected setupIntegrations() {
38
- //
39
- // }
53
+ name: 'npm:sentry-uniapp',
54
+ version: version_1.SDK_VERSION,
55
+ },
56
+ ],
57
+ version: version_1.SDK_VERSION,
58
+ };
59
+ return super._prepareEvent(event, hint, scope);
60
+ }
40
61
  /**
41
- * Show a report dialog to the user to send feedback to a specific event.
42
- * 向用户显示报告对话框以将反馈发送到特定事件。---> 小程序上暂时用不到&不考虑。
43
- *
44
- * @param options Set individual options for the dialog
62
+ * Create an event from an exception.
45
63
  */
46
- MiniappClient.prototype.showReportDialog = function (options) {
47
- if (options === void 0) { options = {}; }
48
- // doesn't work without a document (React Native)
49
- console.log('sentry-uniapp 暂未实现该方法', options);
50
- };
51
- return MiniappClient;
52
- }(core_1.BaseClient));
53
- exports.MiniappClient = MiniappClient;
64
+ eventFromException(exception, hint) {
65
+ return Promise.resolve((0, eventbuilder_1.eventFromException)(exception, hint));
66
+ }
67
+ /**
68
+ * Create an event from a message.
69
+ */
70
+ eventFromMessage(message, level = 'info', hint) {
71
+ return Promise.resolve((0, eventbuilder_1.eventFromMessage)(message, level, hint));
72
+ }
73
+ }
74
+ exports.UniappClient = UniappClient;
54
75
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAGjD,qCAA2D;AAC3D,qCAAkD;AA6BlD;;;;;GAKG;AACH;IAAmC,yCAA0C;IAC3E;;;;OAIG;IACH,uBAAmB,OAA4B;QAA5B,wBAAA,EAAA,YAA4B;eAC7C,kBAAM,wBAAc,EAAE,OAAO,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,qCAAa,GAAvB,UAAwB,KAAY,EAAE,KAAa,EAAE,IAAgB;QACnE,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,YAAY,CAAC;QAChD,KAAK,CAAC,GAAG,yCACJ,KAAK,CAAC,GAAG,KACZ,IAAI,EAAE,kBAAQ,EACd,QAAQ,mBACH,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAC5C;oBACE,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE,qBAAW;iBACrB;gBAEH,OAAO,EAAE,qBAAW,GACrB,CAAC;QAEF,OAAO,iBAAM,aAAa,YAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,kCAAkC;IAClC,EAAE;IACF,IAAI;IAEJ;;;;;OAKG;IACI,wCAAgB,GAAvB,UAAwB,OAAiC;QAAjC,wBAAA,EAAA,YAAiC;QACvD,iDAAiD;QACjD,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IACH,oBAAC;AAAD,CAAC,AA7CD,CAAmC,iBAAU,GA6C5C;AA7CY,sCAAa","sourcesContent":["import { BaseClient, Scope } from \"@sentry/core\";\nimport { DsnLike, Event, EventHint } from \"@sentry/types\";\n\nimport { MiniappBackend, MiniappOptions } from \"./backend\";\nimport { SDK_NAME, SDK_VERSION } from \"./version\";\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n [key: string]: any;\n eventId?: string;\n dsn?: DsnLike;\n user?: {\n email?: string;\n name?: string;\n };\n lang?: string;\n title?: string;\n subtitle?: string;\n subtitle2?: string;\n labelName?: string;\n labelEmail?: string;\n labelComments?: string;\n labelClose?: string;\n labelSubmit?: string;\n errorGeneric?: string;\n errorFormEntry?: string;\n successMessage?: string;\n /** Callback after reportDialog showed up */\n onLoad?(): void;\n}\n\n/**\n * The Sentry Miniapp SDK Client.\n *\n * @see MiniappOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class MiniappClient extends BaseClient<MiniappBackend, MiniappOptions> {\n /**\n * Creates a new Miniapp SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: MiniappOptions = {}) {\n super(MiniappBackend, options);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike<Event | null> {\n event.platform = event.platform || \"javascript\";\n event.sdk = {\n ...event.sdk,\n name: SDK_NAME,\n packages: [\n ...((event.sdk && event.sdk.packages) || []),\n {\n name: \"npm:sentry-uniapp\",\n version: SDK_VERSION\n }\n ],\n version: SDK_VERSION\n };\n\n return super._prepareEvent(event, scope, hint);\n }\n\n // protected setupIntegrations() {\n //\n // }\n\n /**\n * Show a report dialog to the user to send feedback to a specific event.\n * 向用户显示报告对话框以将反馈发送到特定事件。---> 小程序上暂时用不到&不考虑。\n *\n * @param options Set individual options for the dialog\n */\n public showReportDialog(options: ReportDialogOptions = {}): void {\n // doesn't work without a document (React Native)\n console.log('sentry-uniapp 暂未实现该方法', options);\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AACxE,uDAAuD;AACvD,qGAAqG;AACrG,wFAAwF;AACxF,mEAAmE;AACnE,uCAA0C;AAG1C,iDAAsE;AACtE,2CAAkD;AAClD,uCAAkD;AAClD,mCAA+C;AAgC/C;;GAEG;AACH,MAAa,YAAa,SAAQ,iBAAyB;IACzD;;OAEG;IACH,YAAmB,OAAsB;QACvC,IAAA,gBAAQ,EAAC,oCAAoC,CAAC,CAAC;QAC/C,IAAA,gBAAQ,EAAC,8BAA8B,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACtD,IAAA,gBAAQ,EAAC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,OAAe,EACf,QAAuB,MAAM,EAC7B,IAAgB;QAEhB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,+BAAgB,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;CACF;AAtED,oCAsEC"}
@@ -13,6 +13,6 @@ interface SDK {
13
13
  getLaunchOptionsSync?: Function;
14
14
  }
15
15
  declare const sdk: SDK;
16
- declare const appName: "unknown" | "uniapp" | "wechat" | "alipay" | "bytedance" | "dingtalk" | "qq" | "swan";
16
+ declare const appName: "uniapp" | "wechat" | "alipay" | "bytedance" | "dingtalk" | "qq" | "swan" | "unknown";
17
17
  export { sdk, appName };
18
18
  //# sourceMappingURL=crossPlatform.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"crossPlatform.d.ts","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":"AAUA;;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;AAiGD,QAAA,MAAM,GAAG,KAAW,CAAC;AACrB,QAAA,MAAM,OAAO,uFAAe,CAAC;AAE7B,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC"}
@@ -1,55 +1,71 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.appName = exports.sdk = void 0;
3
- var currentSdk = {
4
+ const debug_1 = require("./debug");
5
+ let currentSdk = {
4
6
  // tslint:disable-next-line: no-empty
5
- request: function () {
7
+ request: () => {
6
8
  },
7
9
  // tslint:disable-next-line: no-empty
8
- httpRequest: function () {
10
+ httpRequest: () => {
9
11
  },
10
12
  // tslint:disable-next-line: no-empty
11
- getSystemInfoSync: function () {
13
+ getSystemInfoSync: () => {
12
14
  },
13
15
  // tslint:disable-next-line: no-empty
14
- getSystemInfo: function () {
16
+ getSystemInfo: () => {
15
17
  },
16
18
  };
17
19
  /**
18
20
  * 获取跨平台的 SDK
19
21
  */
20
- var getSDK = function () {
22
+ const getSDK = () => {
23
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] Detecting platform...');
24
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] typeof uni:', typeof uni);
25
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] typeof wx:', typeof wx);
21
26
  if (typeof uni === "object") {
27
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] Using uni SDK');
28
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] uni.request available:', typeof uni.request);
22
29
  currentSdk = uni;
23
30
  }
24
31
  else if (typeof wx === "object") {
32
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] Using wx SDK');
33
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] wx.request available:', typeof wx.request);
25
34
  currentSdk = wx;
26
35
  }
27
36
  else if (typeof my === "object") {
37
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] Using my SDK');
28
38
  currentSdk = my;
29
39
  }
30
40
  else if (typeof tt === "object") {
41
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] Using tt SDK');
31
42
  currentSdk = tt;
32
43
  }
33
44
  else if (typeof dd === "object") {
45
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] Using dd SDK');
34
46
  currentSdk = dd;
35
47
  }
36
48
  else if (typeof qq === "object") {
49
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] Using qq SDK');
37
50
  currentSdk = qq;
38
51
  }
39
52
  else if (typeof swan === "object") {
53
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] Using swan SDK');
40
54
  currentSdk = swan;
41
55
  }
42
56
  else {
57
+ (0, debug_1.debugError)('[Sentry CrossPlatform] No supported platform detected!');
43
58
  // tslint:disable-next-line:no-console
44
59
  console.log("sentry-uniapp 暂不支持此平台, 快应用请使用 sentry-quickapp");
45
60
  }
61
+ (0, debug_1.debugLog)('[Sentry CrossPlatform] Final SDK.request type:', typeof currentSdk.request);
46
62
  return currentSdk;
47
63
  };
48
64
  /**
49
65
  * 获取平台名称
50
66
  */
51
- var getAppName = function () {
52
- var currentAppName = "unknown";
67
+ const getAppName = () => {
68
+ let currentAppName = "unknown";
53
69
  if (typeof uni === "object") {
54
70
  currentAppName = "uniapp";
55
71
  }
@@ -73,8 +89,8 @@ var getAppName = function () {
73
89
  }
74
90
  return currentAppName;
75
91
  };
76
- var sdk = getSDK();
92
+ const sdk = getSDK();
77
93
  exports.sdk = sdk;
78
- var appName = getAppName();
94
+ const appName = getAppName();
79
95
  exports.appName = appName;
80
96
  //# sourceMappingURL=crossPlatform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crossPlatform.js","sourceRo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Q,EAAE;QACjC,cAAc,GAAG,QAAQ,CAAC;KAC3B;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;QACjC,cAAc,GAAG,WAAW,CAAC;KAC9B;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;QACjC,cAAc,GAAG,UAAU,CAAC;KAC7B;SAAM,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;QACjC,cAAc,GAAG,IAAI,CAAC;KACvB;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QACnC,cAAc,GAAG,MAAM,CAAC;KACzB;IAED,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAEF,IAAM,GAAG,GAAG,MAAM,EAAE,CAAC;AAGb,kBAAG;AAFX,IAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAEhB,0BAAO","sourcesContent":["declare const uni: any; // uniapp\ndeclare const wx: any; // 微信小程序、微信小游戏\ndeclare const my: any; // 支付宝小程序\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 = wx;\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"]}
1
+ {"version":3,"file":"crossPlatform.js","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":";;;AAQA,mCAA+C;AA+B/C,IAAI,UAAU,GAAQ;IACpB,qCAAqC;IACrC,OAAO,EAAE,GAAG,EAAE;IACd,CAAC;IACD,qCAAqC;IACrC,WAAW,EAAE,GAAG,EAAE;IAClB,CAAC;IACD,qCAAqC;IACrC,iBAAiB,EAAE,GAAG,EAAE;IACxB,CAAC;IACD,qCAAqC;IACrC,aAAa,EAAE,GAAG,EAAE;IACpB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,EAAE;IAClB,IAAA,gBAAQ,EAA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led(enabled: boolean): void;
2
+ export declare function debugLog(...args: any[]): void;
3
+ export declare function debugError(...args: any[]): void;
4
+ //# sourceMappingURL=debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEtD;AAED,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAI7C;AAED,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAI/C"}
package/dist/debug.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setDebugEnabled = setDebugEnabled;
4
+ exports.debugLog = debugLog;
5
+ exports.debugError = debugError;
6
+ /**
7
+ * Debug logger utility
8
+ */
9
+ let debugEnabled = false;
10
+ function setDebugEnabled(enabled) {
11
+ debugEnabled = enabled;
12
+ }
13
+ function debugLog(...args) {
14
+ if (debugEnabled) {
15
+ console.log(...args);
16
+ }
17
+ }
18
+ function debugError(...args) {
19
+ if (debugEnabled) {
20
+ console.error(...args);
21
+ }
22
+ }
23
+ //# sourceMappingURL=debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":";;AAKA,0CAEC;AAED,4BAIC;AAED,gCAIC;AAnBD;;GAEG;AACH,IAAI,YAAY,GAAG,KAAK,CAAC;AAEzB,SAAgB,eAAe,CAAC,OAAgB;IAC5C,YAAY,GAAG,OAAO,CAAC;AAC3B,CAAC;AAED,SAAgB,QAAQ,CAAC,GAAG,IAAW;IACnC,IAAI,YAAY,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC;AACL,CAAC;AAED,SAAgB,UAAU,CAAC,GAAG,IAAW;IACrC,IAAI,YAAY,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC"}
@@ -1,11 +1,10 @@
1
- import { Event } from '@sentry/types';
2
- /** JSDoc */
3
- export declare function eventFromUnknownInput(exception: unknown, syntheticException?: Error, options?: {
4
- rejection?: boolean;
5
- attachStacktrace?: boolean;
6
- }): Event;
7
- /** JSDoc */
8
- export declare function eventFromString(input: string, syntheticException?: Error, options?: {
9
- attachStacktrace?: boolean;
10
- }): Event;
1
+ import type { Event, EventHint, SeverityLevel } from '@sentry/core';
2
+ /**
3
+ * Builds an Event from an Exception
4
+ */
5
+ export declare function eventFromException(exception: unknown, hint?: EventHint): Event;
6
+ /**
7
+ * Builds an Event from a Message
8
+ */
9
+ export declare function eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): Event;
11
10
  //# sourceMappingURL=eventbuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventbuilder.d.ts","sourceRoot":"","sources":["../src/eventbuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAetC,YAAY;AACZ,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,OAAO,EAClB,kBAAkB,CAAC,EAAE,KAAK,EAC1B,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACvB,GACL,KAAK,CAwDP;AAGD,YAAY;AACZ,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,KAAK,EAC1B,OAAO,GAAE;IACP,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACvB,GACL,KAAK,CAcP"}
1
+ {"version":3,"file":"eventbuilder.d.ts","sourceRoot":"","sources":["../src/eventbuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAa,aAAa,EAAc,MAAM,cAAc,CAAC;AAM3F;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAkB9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,aAAsB,EAC7B,IAAI,CAAC,EAAE,SAAS,GACf,KAAK,CAaP"}