@icanbwell/types 0.40.1 → 0.40.3
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/frontend-telemetry.js +39 -0
- package/index.js +1 -1
- package/native-bridge.js +1 -0
- package/package.json +10 -1
- package/src/frontend-telemetry.d.ts +40 -0
- package/src/index.d.ts +1 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Codes should be used in combination with the BwellError
|
|
3
|
+
* They categorize known error conditions and provide a mechanism for customized error handling.
|
|
4
|
+
*/
|
|
5
|
+
var ErrorCode;
|
|
6
|
+
(function (ErrorCode) {
|
|
7
|
+
// Initialization Errors
|
|
8
|
+
/** Client or client key is unknown */
|
|
9
|
+
ErrorCode["CLIENT_UNKNOWN"] = "CLIENT_UNKNOWN";
|
|
10
|
+
/** Insufficient feature services defined by embeddable */
|
|
11
|
+
ErrorCode["INSUFFICIENT_SERVICES"] = "INSUFFICIENT_SERVICES";
|
|
12
|
+
/** Method called before initialization */
|
|
13
|
+
ErrorCode["METHOD_CALLED_BEFORE_INITIALIZATION"] = "METHOD_CALLED_BEFORE_INITIALIZATION";
|
|
14
|
+
/** General initialization failure of Bwell object */
|
|
15
|
+
ErrorCode["BWELL_INITIALIZATION"] = "BWELL_INITIALIZATION";
|
|
16
|
+
/** Error durring token exchange */
|
|
17
|
+
ErrorCode["TOKEN_EXCHANGE"] = "TOKEN_EXCHANGE";
|
|
18
|
+
// Routing Errors
|
|
19
|
+
/** Defines an error while executing a route */
|
|
20
|
+
ErrorCode["ROUTE_ACTION"] = "ROUTE_ACTION";
|
|
21
|
+
/** Defines an error while initializing the navigation service delegate */
|
|
22
|
+
ErrorCode["ROUTE_NAVIGATION_DELEGATE"] = "ROUTE_NAVIGATION_DELEGATE";
|
|
23
|
+
/** Specifies the the route is unknown */
|
|
24
|
+
ErrorCode["ROUTE_UNKNOWN"] = "ROUTE_UNKNOWN";
|
|
25
|
+
/** An elementId in the route definition does not have a matching element in the registry */
|
|
26
|
+
ErrorCode["ROUTE_ELEMENT_UNKNOWN"] = "ROUTE_ELEMENT_UNKNOWN";
|
|
27
|
+
// React Errors
|
|
28
|
+
/** Hook or Consumer used outside of a React Provider */
|
|
29
|
+
ErrorCode["PROVIDER_UNDEFINED"] = "PROVIDER_UNDEFINED";
|
|
30
|
+
// Miscelaneous Errors
|
|
31
|
+
/** Configuration Error */
|
|
32
|
+
ErrorCode["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
|
|
33
|
+
/** Network Error */
|
|
34
|
+
ErrorCode["NETWORK"] = "NETWORK";
|
|
35
|
+
/** Unknown error */
|
|
36
|
+
ErrorCode["UNKNOWN"] = "UNKNOWN";
|
|
37
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
38
|
+
|
|
39
|
+
export { ErrorCode };
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { ErrorCode } from './frontend-telemetry.js';
|
package/native-bridge.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icanbwell/types",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.3",
|
|
4
4
|
"typedoc": {
|
|
5
5
|
"entryPoint": "./src/index.ts",
|
|
6
6
|
"tsconfig": "./tsconfig.lib.json"
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
],
|
|
13
13
|
"native-bridge": [
|
|
14
14
|
"src/native-bridge.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"frontend-telemetry": [
|
|
17
|
+
"src/frontend-telemetry.d.ts"
|
|
15
18
|
]
|
|
16
19
|
}
|
|
17
20
|
},
|
|
@@ -24,11 +27,17 @@
|
|
|
24
27
|
"types": "./src/native-bridge.d.ts",
|
|
25
28
|
"import": "./native-bridge.js"
|
|
26
29
|
},
|
|
30
|
+
"./frontend-telemetry": {
|
|
31
|
+
"types": "./src/frontend-telemetry.d.ts",
|
|
32
|
+
"import": "./frontend-telemetry.js"
|
|
33
|
+
},
|
|
27
34
|
".": {
|
|
28
35
|
"types": "./src/index.d.ts",
|
|
29
36
|
"import": "./index.js"
|
|
30
37
|
}
|
|
31
38
|
},
|
|
39
|
+
"repoVersion": "1.26.1",
|
|
40
|
+
"description": "@icanbwell/types. repo version: 1.26.1",
|
|
32
41
|
"module": "./index.js",
|
|
33
42
|
"main": "./index.js",
|
|
34
43
|
"type": "module",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Codes should be used in combination with the BwellError
|
|
3
|
+
* They categorize known error conditions and provide a mechanism for customized error handling.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ErrorCode {
|
|
6
|
+
/** Client or client key is unknown */
|
|
7
|
+
CLIENT_UNKNOWN = "CLIENT_UNKNOWN",
|
|
8
|
+
/** Insufficient feature services defined by embeddable */
|
|
9
|
+
INSUFFICIENT_SERVICES = "INSUFFICIENT_SERVICES",
|
|
10
|
+
/** Method called before initialization */
|
|
11
|
+
METHOD_CALLED_BEFORE_INITIALIZATION = "METHOD_CALLED_BEFORE_INITIALIZATION",
|
|
12
|
+
/** General initialization failure of Bwell object */
|
|
13
|
+
BWELL_INITIALIZATION = "BWELL_INITIALIZATION",
|
|
14
|
+
/** Error durring token exchange */
|
|
15
|
+
TOKEN_EXCHANGE = "TOKEN_EXCHANGE",
|
|
16
|
+
/** Defines an error while executing a route */
|
|
17
|
+
ROUTE_ACTION = "ROUTE_ACTION",
|
|
18
|
+
/** Defines an error while initializing the navigation service delegate */
|
|
19
|
+
ROUTE_NAVIGATION_DELEGATE = "ROUTE_NAVIGATION_DELEGATE",
|
|
20
|
+
/** Specifies the the route is unknown */
|
|
21
|
+
ROUTE_UNKNOWN = "ROUTE_UNKNOWN",
|
|
22
|
+
/** An elementId in the route definition does not have a matching element in the registry */
|
|
23
|
+
ROUTE_ELEMENT_UNKNOWN = "ROUTE_ELEMENT_UNKNOWN",
|
|
24
|
+
/** Hook or Consumer used outside of a React Provider */
|
|
25
|
+
PROVIDER_UNDEFINED = "PROVIDER_UNDEFINED",
|
|
26
|
+
/** Configuration Error */
|
|
27
|
+
CONFIGURATION_ERROR = "CONFIGURATION_ERROR",
|
|
28
|
+
/** Network Error */
|
|
29
|
+
NETWORK = "NETWORK",
|
|
30
|
+
/** Unknown error */
|
|
31
|
+
UNKNOWN = "UNKNOWN"
|
|
32
|
+
}
|
|
33
|
+
export type ErrorDetails = {
|
|
34
|
+
message: string;
|
|
35
|
+
errorCode: ErrorCode;
|
|
36
|
+
};
|
|
37
|
+
export type ErrorContext = {
|
|
38
|
+
errorDetails: ErrorDetails;
|
|
39
|
+
resetError: () => void;
|
|
40
|
+
};
|
package/src/index.d.ts
CHANGED