@wix/monitoring-types 0.1.0
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/build/browser/index.mjs +0 -0
- package/build/index.d.mts +128 -0
- package/build/index.d.ts +128 -0
- package/build/index.js +18 -0
- package/build/index.mjs +0 -0
- package/package.json +57 -0
|
File without changes
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
type Primitive = number | string | boolean | bigint | symbol | null | undefined;
|
|
2
|
+
type Tags = Record<string, Primitive>;
|
|
3
|
+
type Context = Record<string, unknown>;
|
|
4
|
+
type Contexts = Record<string, Context | undefined>;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents the context for host monitoring.
|
|
8
|
+
*/
|
|
9
|
+
interface HostMonitoringContext {
|
|
10
|
+
/**
|
|
11
|
+
* The unique identifier for the application.
|
|
12
|
+
*/
|
|
13
|
+
appId: string;
|
|
14
|
+
/**
|
|
15
|
+
* The version of the application.
|
|
16
|
+
*/
|
|
17
|
+
appVersion: string;
|
|
18
|
+
/**
|
|
19
|
+
* The unique identifier for the application instance.
|
|
20
|
+
*/
|
|
21
|
+
appInstanceId: string;
|
|
22
|
+
/**
|
|
23
|
+
* The unique identifier for the extension.
|
|
24
|
+
*/
|
|
25
|
+
extensionId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The name of the extension.
|
|
28
|
+
*/
|
|
29
|
+
extensionName?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The platform the extension is on. (e.g. 'dashboard', 'editor', 'site', 'backend)
|
|
32
|
+
*/
|
|
33
|
+
extensionPlatform?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The type of the extension on the platform. (e.g. backend: ['api', 'events], dashboard: ['widget', 'page'], site: ['component', 'widget'])
|
|
36
|
+
*/
|
|
37
|
+
extensionType?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Additional data related to the extension.
|
|
40
|
+
*/
|
|
41
|
+
extensionData?: Record<string, unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* The type of the subject.
|
|
44
|
+
* Can be 'USER', 'MEMBER', or 'VISITOR'.
|
|
45
|
+
*/
|
|
46
|
+
subjectType?: 'USER' | 'MEMBER' | 'VISITOR';
|
|
47
|
+
/**
|
|
48
|
+
* The unique identifier for the subject.
|
|
49
|
+
*/
|
|
50
|
+
subjectId?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The type of the tenant.
|
|
53
|
+
* Can be 'ACCOUNT' or 'SITE'.
|
|
54
|
+
*/
|
|
55
|
+
tenantType?: 'ACCOUNT' | 'SITE';
|
|
56
|
+
/**
|
|
57
|
+
* The unique identifier for the tenant.
|
|
58
|
+
*/
|
|
59
|
+
tenantId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The URL of the site.
|
|
62
|
+
*/
|
|
63
|
+
siteUrl?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface SpanContextData {
|
|
67
|
+
traceId: string;
|
|
68
|
+
spanId: string;
|
|
69
|
+
}
|
|
70
|
+
interface Span {
|
|
71
|
+
spanContext(): SpanContextData;
|
|
72
|
+
end(): void;
|
|
73
|
+
}
|
|
74
|
+
interface SpanOptions {
|
|
75
|
+
name: string;
|
|
76
|
+
tags?: Tags;
|
|
77
|
+
}
|
|
78
|
+
interface Breadcrumb {
|
|
79
|
+
type?: string;
|
|
80
|
+
category?: string;
|
|
81
|
+
message: string;
|
|
82
|
+
level?: 'info' | 'warning' | 'error';
|
|
83
|
+
data?: Record<string, unknown>;
|
|
84
|
+
}
|
|
85
|
+
interface CaptureContext {
|
|
86
|
+
level?: 'info' | 'warning' | 'error';
|
|
87
|
+
tags?: Tags;
|
|
88
|
+
contexts?: Contexts;
|
|
89
|
+
}
|
|
90
|
+
interface MonitoringClient {
|
|
91
|
+
captureException(error: unknown, context?: CaptureContext): void;
|
|
92
|
+
captureMessage(message: string, context?: CaptureContext): void;
|
|
93
|
+
startSpan<T>(options: SpanOptions, callback: (span: Span | undefined) => T): T;
|
|
94
|
+
addBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface EventTags extends Tags {
|
|
98
|
+
'app.id': string;
|
|
99
|
+
'app.version': string;
|
|
100
|
+
'app.instanceId': string;
|
|
101
|
+
'extension.id'?: string;
|
|
102
|
+
'extension.name'?: string;
|
|
103
|
+
'extension.platform'?: string;
|
|
104
|
+
'extension.type'?: string;
|
|
105
|
+
}
|
|
106
|
+
interface EventContexts extends Contexts {
|
|
107
|
+
extension?: {
|
|
108
|
+
type?: string;
|
|
109
|
+
data?: Record<string, unknown>;
|
|
110
|
+
};
|
|
111
|
+
identity?: {
|
|
112
|
+
type?: string;
|
|
113
|
+
id?: string;
|
|
114
|
+
};
|
|
115
|
+
site?: {
|
|
116
|
+
url?: string;
|
|
117
|
+
id?: string;
|
|
118
|
+
};
|
|
119
|
+
account?: {
|
|
120
|
+
id?: string;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
interface EventData {
|
|
124
|
+
tags: EventTags;
|
|
125
|
+
contexts: EventContexts;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export type { Breadcrumb, CaptureContext, Context, Contexts, EventContexts, EventData, EventTags, HostMonitoringContext, MonitoringClient, Primitive, Span, SpanContextData, SpanOptions, Tags };
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
type Primitive = number | string | boolean | bigint | symbol | null | undefined;
|
|
2
|
+
type Tags = Record<string, Primitive>;
|
|
3
|
+
type Context = Record<string, unknown>;
|
|
4
|
+
type Contexts = Record<string, Context | undefined>;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents the context for host monitoring.
|
|
8
|
+
*/
|
|
9
|
+
interface HostMonitoringContext {
|
|
10
|
+
/**
|
|
11
|
+
* The unique identifier for the application.
|
|
12
|
+
*/
|
|
13
|
+
appId: string;
|
|
14
|
+
/**
|
|
15
|
+
* The version of the application.
|
|
16
|
+
*/
|
|
17
|
+
appVersion: string;
|
|
18
|
+
/**
|
|
19
|
+
* The unique identifier for the application instance.
|
|
20
|
+
*/
|
|
21
|
+
appInstanceId: string;
|
|
22
|
+
/**
|
|
23
|
+
* The unique identifier for the extension.
|
|
24
|
+
*/
|
|
25
|
+
extensionId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The name of the extension.
|
|
28
|
+
*/
|
|
29
|
+
extensionName?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The platform the extension is on. (e.g. 'dashboard', 'editor', 'site', 'backend)
|
|
32
|
+
*/
|
|
33
|
+
extensionPlatform?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The type of the extension on the platform. (e.g. backend: ['api', 'events], dashboard: ['widget', 'page'], site: ['component', 'widget'])
|
|
36
|
+
*/
|
|
37
|
+
extensionType?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Additional data related to the extension.
|
|
40
|
+
*/
|
|
41
|
+
extensionData?: Record<string, unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* The type of the subject.
|
|
44
|
+
* Can be 'USER', 'MEMBER', or 'VISITOR'.
|
|
45
|
+
*/
|
|
46
|
+
subjectType?: 'USER' | 'MEMBER' | 'VISITOR';
|
|
47
|
+
/**
|
|
48
|
+
* The unique identifier for the subject.
|
|
49
|
+
*/
|
|
50
|
+
subjectId?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The type of the tenant.
|
|
53
|
+
* Can be 'ACCOUNT' or 'SITE'.
|
|
54
|
+
*/
|
|
55
|
+
tenantType?: 'ACCOUNT' | 'SITE';
|
|
56
|
+
/**
|
|
57
|
+
* The unique identifier for the tenant.
|
|
58
|
+
*/
|
|
59
|
+
tenantId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The URL of the site.
|
|
62
|
+
*/
|
|
63
|
+
siteUrl?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface SpanContextData {
|
|
67
|
+
traceId: string;
|
|
68
|
+
spanId: string;
|
|
69
|
+
}
|
|
70
|
+
interface Span {
|
|
71
|
+
spanContext(): SpanContextData;
|
|
72
|
+
end(): void;
|
|
73
|
+
}
|
|
74
|
+
interface SpanOptions {
|
|
75
|
+
name: string;
|
|
76
|
+
tags?: Tags;
|
|
77
|
+
}
|
|
78
|
+
interface Breadcrumb {
|
|
79
|
+
type?: string;
|
|
80
|
+
category?: string;
|
|
81
|
+
message: string;
|
|
82
|
+
level?: 'info' | 'warning' | 'error';
|
|
83
|
+
data?: Record<string, unknown>;
|
|
84
|
+
}
|
|
85
|
+
interface CaptureContext {
|
|
86
|
+
level?: 'info' | 'warning' | 'error';
|
|
87
|
+
tags?: Tags;
|
|
88
|
+
contexts?: Contexts;
|
|
89
|
+
}
|
|
90
|
+
interface MonitoringClient {
|
|
91
|
+
captureException(error: unknown, context?: CaptureContext): void;
|
|
92
|
+
captureMessage(message: string, context?: CaptureContext): void;
|
|
93
|
+
startSpan<T>(options: SpanOptions, callback: (span: Span | undefined) => T): T;
|
|
94
|
+
addBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface EventTags extends Tags {
|
|
98
|
+
'app.id': string;
|
|
99
|
+
'app.version': string;
|
|
100
|
+
'app.instanceId': string;
|
|
101
|
+
'extension.id'?: string;
|
|
102
|
+
'extension.name'?: string;
|
|
103
|
+
'extension.platform'?: string;
|
|
104
|
+
'extension.type'?: string;
|
|
105
|
+
}
|
|
106
|
+
interface EventContexts extends Contexts {
|
|
107
|
+
extension?: {
|
|
108
|
+
type?: string;
|
|
109
|
+
data?: Record<string, unknown>;
|
|
110
|
+
};
|
|
111
|
+
identity?: {
|
|
112
|
+
type?: string;
|
|
113
|
+
id?: string;
|
|
114
|
+
};
|
|
115
|
+
site?: {
|
|
116
|
+
url?: string;
|
|
117
|
+
id?: string;
|
|
118
|
+
};
|
|
119
|
+
account?: {
|
|
120
|
+
id?: string;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
interface EventData {
|
|
124
|
+
tags: EventTags;
|
|
125
|
+
contexts: EventContexts;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export type { Breadcrumb, CaptureContext, Context, Contexts, EventContexts, EventData, EventTags, HostMonitoringContext, MonitoringClient, Primitive, Span, SpanContextData, SpanOptions, Tags };
|
package/build/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/index.ts
|
|
17
|
+
var src_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(src_exports);
|
package/build/index.mjs
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wix/monitoring-types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Gili Shohat",
|
|
7
|
+
"email": "gilish@wix.com"
|
|
8
|
+
},
|
|
9
|
+
"main": "build/index.js",
|
|
10
|
+
"module": "build/index.mjs",
|
|
11
|
+
"browser": "build/browser/index.mjs",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"types": "build/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"build"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"registry": "https://registry.npmjs.org/",
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsup",
|
|
23
|
+
"test": ":",
|
|
24
|
+
"lint": "eslint --max-warnings=0 .",
|
|
25
|
+
"lint:fix": "eslint --max-warnings=0 . --fix",
|
|
26
|
+
"typecheck": "tsc --noEmit"
|
|
27
|
+
},
|
|
28
|
+
"lint-staged": {
|
|
29
|
+
"*.{js,ts}": "yarn lint"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^20.17.9",
|
|
33
|
+
"eslint": "^8.57.1",
|
|
34
|
+
"eslint-config-sdk": "0.0.0",
|
|
35
|
+
"tsup": "^7.3.0",
|
|
36
|
+
"type-fest": "^4.30.0",
|
|
37
|
+
"typescript": "^5.7.2"
|
|
38
|
+
},
|
|
39
|
+
"eslintConfig": {
|
|
40
|
+
"extends": "sdk"
|
|
41
|
+
},
|
|
42
|
+
"wix": {
|
|
43
|
+
"artifact": {
|
|
44
|
+
"groupId": "com.wixpress",
|
|
45
|
+
"artifactId": "monitoring-types"
|
|
46
|
+
},
|
|
47
|
+
"validations": {
|
|
48
|
+
"source": [
|
|
49
|
+
"lint"
|
|
50
|
+
],
|
|
51
|
+
"postDependenciesBuild": [
|
|
52
|
+
"typecheck"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"falconPackageHash": "d3a1ea4448112dd558b217c373f5510b187104236ef06e939511dffc"
|
|
57
|
+
}
|