@minecraft/diagnostics 1.0.0-beta.1.21.94-stable → 1.0.0-beta.1.26.0-preview.24

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 (3) hide show
  1. package/README.md +8 -8
  2. package/index.d.ts +48 -16
  3. package/package.json +19 -19
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # `@minecraft/diagnostics`
2
-
3
- Contains diagnostics functionality for discovering and diagnosing issues with content.
4
-
5
- ## **NOTE: This version of this module is still in pre-release. It may change or it may be removed in future releases.**
6
-
7
- See full documentation for this module here:
8
-
1
+ # `@minecraft/diagnostics`
2
+
3
+ Contains diagnostics functionality for discovering and diagnosing issues with content.
4
+
5
+ ## **NOTE: This version of this module is still in pre-release. It may change or it may be removed in future releases.**
6
+
7
+ See full documentation for this module here:
8
+
9
9
  https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/diagnostics/minecraft-diagnostics
package/index.d.ts CHANGED
@@ -24,15 +24,16 @@
24
24
  import * as minecraftcommon from '@minecraft/common';
25
25
  import * as minecraftserveradmin from '@minecraft/server-admin';
26
26
  /**
27
- * This defines the severity level of the breadcrumb. Levels
28
- * are used in the UI to emphasize and deemphasize the crumb.
29
- * The default is info. See Sentry documentation for more
30
- * information:
27
+ * This defines the severity level of an error, event,
28
+ * exception, or breadcrumb. Levels are used in the UI to
29
+ * emphasize and deemphasize breadcrumbs. See Sentry
30
+ * documentation for more information:
31
31
  * https://docs.sentry.io/product/issues/issue-details/breadcrumbs/
32
32
  */
33
- export enum SentryBreadcrumbLevel {
33
+ export enum SentryEventLevel {
34
34
  debug = 'debug',
35
35
  error = 'error',
36
+ fatal = 'fatal',
36
37
  info = 'info',
37
38
  warning = 'warning',
38
39
  }
@@ -50,8 +51,6 @@ export class Sentry {
50
51
  * up to an error. See Sentry documentation for more details:
51
52
  * https://docs.sentry.io/product/issues/issue-details/breadcrumbs/
52
53
  *
53
- * This function can't be called in read-only mode.
54
- *
55
54
  * This function can be called in early-execution mode.
56
55
  *
57
56
  * @param message
@@ -62,15 +61,13 @@ export class Sentry {
62
61
  *
63
62
  * {@link SentryUninitializedError}
64
63
  */
65
- addBreadcrumb(level: SentryBreadcrumbLevel, message: string, category?: string): void;
64
+ addBreadcrumb(level: SentryEventLevel, message: string, category?: string): void;
66
65
  /**
67
66
  * @remarks
68
67
  * Adds a tag to the Sentry session. See Sentry documentation
69
68
  * for more details:
70
69
  * https://docs.sentry.io/platforms/javascript/enriching-events/tags/
71
70
  *
72
- * This function can't be called in read-only mode.
73
- *
74
71
  * This function can be called in early-execution mode.
75
72
  *
76
73
  * @throws This function can throw errors.
@@ -78,14 +75,28 @@ export class Sentry {
78
75
  * {@link SentryUninitializedError}
79
76
  */
80
77
  addTag(name: string, value: string): void;
78
+ /**
79
+ * @remarks
80
+ * Captures an exception event and send it to Sentry. Note that
81
+ * you can pass not only `Error` objects, but also other types
82
+ * of thrown objects - in that case, an attempt will be made to
83
+ * serialize the object for you, and stack traces are likely to
84
+ * be missing. See Sentry documentation for more details:
85
+ * https://docs.sentry.io/platforms/javascript/apis/#capturing-events
86
+ *
87
+ * This function can be called in early-execution mode.
88
+ *
89
+ * @throws This function can throw errors.
90
+ *
91
+ * {@link SentryUninitializedError}
92
+ */
93
+ captureException(exception: unknown, captureContext?: SentryCaptureContext): void;
81
94
  /**
82
95
  * @remarks
83
96
  * Gets the list of all session tags. See Sentry documentation
84
97
  * for more details:
85
98
  * https://docs.sentry.io/platforms/javascript/enriching-events/tags/
86
99
  *
87
- * This function can't be called in read-only mode.
88
- *
89
100
  * This function can be called in early-execution mode.
90
101
  *
91
102
  * @throws This function can throw errors.
@@ -98,8 +109,6 @@ export class Sentry {
98
109
  * Initializes Sentry for use. This must be successfully
99
110
  * called before any other Sentry functions are called.
100
111
  *
101
- * This function can't be called in read-only mode.
102
- *
103
112
  * This function can be called in early-execution mode.
104
113
  *
105
114
  * @throws This function can throw errors.
@@ -115,8 +124,6 @@ export class Sentry {
115
124
  * documentation for more details:
116
125
  * https://docs.sentry.io/platforms/javascript/enriching-events/tags/
117
126
  *
118
- * This function can't be called in read-only mode.
119
- *
120
127
  * This function can be called in early-execution mode.
121
128
  *
122
129
  * @throws This function can throw errors.
@@ -126,6 +133,31 @@ export class Sentry {
126
133
  removeTag(name: string): void;
127
134
  }
128
135
 
136
+ /**
137
+ * Context relating to a captured exception that should be sent
138
+ * to Sentry.
139
+ */
140
+ export interface SentryCaptureContext {
141
+ /**
142
+ * @remarks
143
+ * Additional data that should be sent with the exception.
144
+ *
145
+ */
146
+ extraData?: Record<string, boolean | number | string>;
147
+ /**
148
+ * @remarks
149
+ * The indicated level of severity of the captured exception.
150
+ *
151
+ */
152
+ level?: SentryEventLevel;
153
+ /**
154
+ * @remarks
155
+ * Additional tags that should be sent with the exception.
156
+ *
157
+ */
158
+ tags?: Record<string, string>;
159
+ }
160
+
129
161
  /**
130
162
  * Describes options for configuring Sentry for this scripting
131
163
  * module.
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
- {
2
- "name": "@minecraft/diagnostics",
3
- "version": "1.0.0-beta.1.21.94-stable",
4
- "description": "",
5
- "contributors": [
6
- {
7
- "name": "Jake Shirley",
8
- "email": "jake@xbox.com"
9
- },
10
- {
11
- "name": "Mike Ammerlaan",
12
- "email": "mikeam@microsoft.com"
13
- }
14
- ],
15
- "dependencies": {
16
- "@minecraft/common": "^1.0.0",
17
- "@minecraft/server-admin": "^1.0.0-beta.1.21.94-stable"
18
- },
19
- "license": "MIT"
1
+ {
2
+ "name": "@minecraft/diagnostics",
3
+ "version": "1.0.0-beta.1.26.0-preview.24",
4
+ "description": "",
5
+ "contributors": [
6
+ {
7
+ "name": "Jake Shirley",
8
+ "email": "jake@xbox.com"
9
+ },
10
+ {
11
+ "name": "Mike Ammerlaan",
12
+ "email": "mikeam@microsoft.com"
13
+ }
14
+ ],
15
+ "peerDependencies": {
16
+ "@minecraft/common": "^1.0.0",
17
+ "@minecraft/server-admin": "^1.0.0-beta.1.26.0-preview.24"
18
+ },
19
+ "license": "MIT"
20
20
  }