@minecraft/diagnostics 1.0.0-beta.1.21.70-preview.22
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 +9 -0
- package/index.d.ts +159 -0
- package/package.json +19 -0
package/README.md
ADDED
|
@@ -0,0 +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
|
+
|
|
9
|
+
https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/diagnostics/minecraft-diagnostics
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// Type definitions for Minecraft Bedrock Edition script APIs
|
|
2
|
+
// Project: https://docs.microsoft.com/minecraft/creator/
|
|
3
|
+
// Definitions by: Jake Shirley <https://github.com/JakeShirley>
|
|
4
|
+
// Mike Ammerlaan <https://github.com/mammerla>
|
|
5
|
+
|
|
6
|
+
/* *****************************************************************************
|
|
7
|
+
Copyright (c) Microsoft Corporation.
|
|
8
|
+
***************************************************************************** */
|
|
9
|
+
/**
|
|
10
|
+
* @beta
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
* Contains diagnostics functionality for discovering and
|
|
13
|
+
* diagnosing issues with content.
|
|
14
|
+
*
|
|
15
|
+
* Manifest Details
|
|
16
|
+
* ```json
|
|
17
|
+
* {
|
|
18
|
+
* "module_name": "@minecraft/diagnostics",
|
|
19
|
+
* "version": "1.0.0-beta"
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
import * as minecraftcommon from '@minecraft/common';
|
|
25
|
+
/**
|
|
26
|
+
* This defines the severity level of the breadcrumb. Levels
|
|
27
|
+
* are used in the UI to emphasize and deemphasize the crumb.
|
|
28
|
+
* The default is info. See Sentry documentation for more
|
|
29
|
+
* information:
|
|
30
|
+
* https://docs.sentry.io/product/issues/issue-details/breadcrumbs/
|
|
31
|
+
*/
|
|
32
|
+
export enum SentryBreadcrumbLevel {
|
|
33
|
+
debug = 'debug',
|
|
34
|
+
error = 'error',
|
|
35
|
+
info = 'info',
|
|
36
|
+
warning = 'warning',
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A class that allows hooking up reporting to Sentry. See
|
|
41
|
+
* https://sentry.io/ for more information.
|
|
42
|
+
*/
|
|
43
|
+
export class Sentry {
|
|
44
|
+
private constructor();
|
|
45
|
+
/**
|
|
46
|
+
* @remarks
|
|
47
|
+
* Adds a breadcrumb to the next Sentry error reported. This
|
|
48
|
+
* can be useful for understanding a "trail" of events leading
|
|
49
|
+
* up to an error. See Sentry documentation for more details:
|
|
50
|
+
* https://docs.sentry.io/product/issues/issue-details/breadcrumbs/
|
|
51
|
+
*
|
|
52
|
+
* This function can't be called in read-only mode.
|
|
53
|
+
*
|
|
54
|
+
* This function can be called in early-execution mode.
|
|
55
|
+
*
|
|
56
|
+
* @param message
|
|
57
|
+
* The message to add to the breadcrumb.
|
|
58
|
+
* @param category
|
|
59
|
+
* The category of the breadcrumb.
|
|
60
|
+
* @throws This function can throw errors.
|
|
61
|
+
*
|
|
62
|
+
* {@link SentryUninitializedError}
|
|
63
|
+
*/
|
|
64
|
+
addBreadcrumb(level: SentryBreadcrumbLevel, message: string, category?: string): void;
|
|
65
|
+
/**
|
|
66
|
+
* @remarks
|
|
67
|
+
* Adds a tag to the Sentry session. See Sentry documentation
|
|
68
|
+
* for more details:
|
|
69
|
+
* https://docs.sentry.io/platforms/javascript/enriching-events/tags/
|
|
70
|
+
*
|
|
71
|
+
* This function can't be called in read-only mode.
|
|
72
|
+
*
|
|
73
|
+
* This function can be called in early-execution mode.
|
|
74
|
+
*
|
|
75
|
+
* @throws This function can throw errors.
|
|
76
|
+
*
|
|
77
|
+
* {@link SentryUninitializedError}
|
|
78
|
+
*/
|
|
79
|
+
addTag(name: string, value: string): void;
|
|
80
|
+
/**
|
|
81
|
+
* @remarks
|
|
82
|
+
* Gets the list of all session tags. See Sentry documentation
|
|
83
|
+
* for more details:
|
|
84
|
+
* https://docs.sentry.io/platforms/javascript/enriching-events/tags/
|
|
85
|
+
*
|
|
86
|
+
* This function can't be called in read-only mode.
|
|
87
|
+
*
|
|
88
|
+
* This function can be called in early-execution mode.
|
|
89
|
+
*
|
|
90
|
+
* @throws This function can throw errors.
|
|
91
|
+
*
|
|
92
|
+
* {@link SentryUninitializedError}
|
|
93
|
+
*/
|
|
94
|
+
getTags(): Record<string, string>;
|
|
95
|
+
/**
|
|
96
|
+
* @remarks
|
|
97
|
+
* Initializes Sentry for use. This must be successfully
|
|
98
|
+
* called before any other Sentry functions are called.
|
|
99
|
+
*
|
|
100
|
+
* This function can't be called in read-only mode.
|
|
101
|
+
*
|
|
102
|
+
* This function can be called in early-execution mode.
|
|
103
|
+
*
|
|
104
|
+
* @throws This function can throw errors.
|
|
105
|
+
*
|
|
106
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
107
|
+
*
|
|
108
|
+
* {@link SentryAlreadyInitializedError}
|
|
109
|
+
*/
|
|
110
|
+
init(options: SentryOptions): void;
|
|
111
|
+
/**
|
|
112
|
+
* @remarks
|
|
113
|
+
* Removes a tag to the Sentry session. See Sentry
|
|
114
|
+
* documentation for more details:
|
|
115
|
+
* https://docs.sentry.io/platforms/javascript/enriching-events/tags/
|
|
116
|
+
*
|
|
117
|
+
* This function can't be called in read-only mode.
|
|
118
|
+
*
|
|
119
|
+
* This function can be called in early-execution mode.
|
|
120
|
+
*
|
|
121
|
+
* @throws This function can throw errors.
|
|
122
|
+
*
|
|
123
|
+
* {@link SentryUninitializedError}
|
|
124
|
+
*/
|
|
125
|
+
removeTag(name: string): void;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Describes options for configuring Sentry for this scripting
|
|
130
|
+
* module.
|
|
131
|
+
*/
|
|
132
|
+
export interface SentryOptions {
|
|
133
|
+
/**
|
|
134
|
+
* @remarks
|
|
135
|
+
* The fully qualified DSN for a Sentry project. See Sentry
|
|
136
|
+
* documentation for more information:
|
|
137
|
+
* https://docs.sentry.io/concepts/key-terms/dsn-explainer/
|
|
138
|
+
*
|
|
139
|
+
*/
|
|
140
|
+
dsn: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
144
|
+
export class SentryAlreadyInitializedError extends Error {
|
|
145
|
+
private constructor();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
149
|
+
export class SentryUninitializedError extends Error {
|
|
150
|
+
private constructor();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @remarks
|
|
155
|
+
* A class that allows hooking up reporting to Sentry. See
|
|
156
|
+
* https://sentry.io/ for more information.
|
|
157
|
+
*
|
|
158
|
+
*/
|
|
159
|
+
export const sentry: Sentry;
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@minecraft/diagnostics",
|
|
3
|
+
"version": "1.0.0-beta.1.21.70-preview.22",
|
|
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
|
+
},
|
|
18
|
+
"license": "MIT"
|
|
19
|
+
}
|