@wix/sdk-types 1.12.5 → 1.12.6

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/index.d.mts CHANGED
@@ -1,3 +1,39 @@
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
+ interface SpanContextData {
7
+ traceId: string;
8
+ spanId: string;
9
+ }
10
+ interface Span {
11
+ spanContext(): SpanContextData;
12
+ end(): void;
13
+ }
14
+ interface SpanOptions {
15
+ name: string;
16
+ tags?: Tags;
17
+ }
18
+ interface Breadcrumb {
19
+ type?: string;
20
+ category?: string;
21
+ message: string;
22
+ level?: 'info' | 'warning' | 'error';
23
+ data?: Record<string, unknown>;
24
+ }
25
+ interface CaptureContext {
26
+ level?: 'info' | 'warning' | 'error';
27
+ tags?: Tags;
28
+ contexts?: Contexts;
29
+ }
30
+ interface MonitoringClient {
31
+ captureException(error: unknown, context?: CaptureContext): void;
32
+ captureMessage(message: string, context?: CaptureContext): void;
33
+ startSpan<T>(options: SpanOptions, callback: (span: Span | undefined) => T): T;
34
+ addBreadcrumb(breadcrumb: Breadcrumb): void;
35
+ }
36
+
1
37
  type HostModule<T, H extends Host> = {
2
38
  __type: 'host';
3
39
  create(host: H): T;
@@ -20,6 +56,10 @@ type Host<Environment = unknown> = {
20
56
  * Optional bast url to use for API requests, for example `www.wixapis.com`
21
57
  */
22
58
  apiBaseUrl?: string;
59
+ /**
60
+ * Optional function to get a monitoring client
61
+ */
62
+ getMonitoringClient?: () => MonitoringClient;
23
63
  /**
24
64
  * Possible data to be provided by every host, for cross cutting concerns
25
65
  * like internationalization, billing, etc.
package/build/index.d.ts CHANGED
@@ -1,3 +1,39 @@
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
+ interface SpanContextData {
7
+ traceId: string;
8
+ spanId: string;
9
+ }
10
+ interface Span {
11
+ spanContext(): SpanContextData;
12
+ end(): void;
13
+ }
14
+ interface SpanOptions {
15
+ name: string;
16
+ tags?: Tags;
17
+ }
18
+ interface Breadcrumb {
19
+ type?: string;
20
+ category?: string;
21
+ message: string;
22
+ level?: 'info' | 'warning' | 'error';
23
+ data?: Record<string, unknown>;
24
+ }
25
+ interface CaptureContext {
26
+ level?: 'info' | 'warning' | 'error';
27
+ tags?: Tags;
28
+ contexts?: Contexts;
29
+ }
30
+ interface MonitoringClient {
31
+ captureException(error: unknown, context?: CaptureContext): void;
32
+ captureMessage(message: string, context?: CaptureContext): void;
33
+ startSpan<T>(options: SpanOptions, callback: (span: Span | undefined) => T): T;
34
+ addBreadcrumb(breadcrumb: Breadcrumb): void;
35
+ }
36
+
1
37
  type HostModule<T, H extends Host> = {
2
38
  __type: 'host';
3
39
  create(host: H): T;
@@ -20,6 +56,10 @@ type Host<Environment = unknown> = {
20
56
  * Optional bast url to use for API requests, for example `www.wixapis.com`
21
57
  */
22
58
  apiBaseUrl?: string;
59
+ /**
60
+ * Optional function to get a monitoring client
61
+ */
62
+ getMonitoringClient?: () => MonitoringClient;
23
63
  /**
24
64
  * Possible data to be provided by every host, for cross cutting concerns
25
65
  * like internationalization, billing, etc.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-types",
3
- "version": "1.12.5",
3
+ "version": "1.12.6",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -29,15 +29,13 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^20.17.9",
32
+ "@wix/monitoring-types": "^0.1.0",
32
33
  "eslint": "^8.57.1",
33
34
  "eslint-config-sdk": "0.0.0",
34
35
  "tsup": "^7.3.0",
35
- "type-fest": "^4.29.0",
36
+ "type-fest": "^4.30.0",
36
37
  "typescript": "^5.7.2"
37
38
  },
38
- "yoshiFlowLibrary": {
39
- "buildEsmWithBabel": true
40
- },
41
39
  "eslintConfig": {
42
40
  "extends": "sdk"
43
41
  },
@@ -58,5 +56,5 @@
58
56
  "wallaby": {
59
57
  "autoDetect": true
60
58
  },
61
- "falconPackageHash": "0d2624979aa91d2fdf561413936058ec3500f8622d610fd50c7cc8da"
59
+ "falconPackageHash": "dcaa5ad4bac20edaae049eb3a12a7b3d0f70e9e87414bd56ba7ba402"
62
60
  }