@wix/sdk-types 1.13.11 → 1.13.13

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.
@@ -1,6 +1,54 @@
1
1
  import { MonitoringClient } from '@wix/monitoring-types';
2
2
  import { ConditionalExcept, EmptyObject, Simplify, Paths, SetRequiredDeep } from 'type-fest';
3
3
 
4
+ interface BiLogger {
5
+ log(params: LogParams, context?: LogOptions): Promise<any>;
6
+ log(eventName: string, params: LogParams, context?: LogOptions): Promise<any>;
7
+ report(reportProps: ReportProps): Promise<any>;
8
+ flush(): Promise<any>;
9
+ updateDefaults(params: LogParams): this;
10
+ }
11
+ interface LogParams {
12
+ [key: string]: any;
13
+ }
14
+ interface LogOptions {
15
+ endpoint?: string;
16
+ useBatch?: number | boolean;
17
+ category?: EventCategories;
18
+ }
19
+ interface ReportProps {
20
+ evid: number;
21
+ src: number;
22
+ endpoint: string;
23
+ params: LogParams;
24
+ }
25
+ declare enum EventCategories {
26
+ Essential = "essential",
27
+ Functional = "functional",
28
+ Analytics = "analytics"
29
+ }
30
+
31
+ declare class ReadOnlyExperiments {
32
+ protected experiments: ExperimentsBag;
33
+ constructor(options: ReadOnlyExperimentsOptions);
34
+ get(key: string): any;
35
+ enabled(key: string): boolean;
36
+ pending(): boolean;
37
+ ready(): Promise<any>;
38
+ all(): ExperimentsBag;
39
+ }
40
+ interface ExperimentsBag {
41
+ [key: string]: string | boolean;
42
+ }
43
+ interface ReadOnlyExperimentsOptions {
44
+ experiments?: ExperimentsBag;
45
+ }
46
+
47
+ type Conductor = {
48
+ isFeatureOn: (featureName: string) => boolean;
49
+ getABTestVariant: (abTestName: string) => 'a' | 'b' | 'c' | 'd' | 'e';
50
+ };
51
+
4
52
  type HostModule<T, H extends Host> = {
5
53
  __type: 'host';
6
54
  create(host: H): T;
@@ -27,6 +75,21 @@ type Host<Environment = unknown> = {
27
75
  * Optional function to get a monitoring client
28
76
  */
29
77
  getMonitoringClient?: () => MonitoringClient;
78
+ /**
79
+ * Optional function to get a bi logger
80
+ * @internal
81
+ */
82
+ getBiLogger?: () => BiLogger;
83
+ /**
84
+ * Optional function to get petri experiments
85
+ * @internal
86
+ */
87
+ getPetriExperimentsClient?: () => ReadOnlyExperiments;
88
+ /**
89
+ * Optional function to get conductor experiments
90
+ * @internal
91
+ */
92
+ getConductorClient?: () => Conductor;
30
93
  /**
31
94
  * Possible data to be provided by every host, for cross cutting concerns
32
95
  * like internationalization, billing, etc.
@@ -1,6 +1,54 @@
1
1
  import { MonitoringClient } from '@wix/monitoring-types';
2
2
  import { ConditionalExcept, EmptyObject, Simplify, Paths, SetRequiredDeep } from 'type-fest';
3
3
 
4
+ interface BiLogger {
5
+ log(params: LogParams, context?: LogOptions): Promise<any>;
6
+ log(eventName: string, params: LogParams, context?: LogOptions): Promise<any>;
7
+ report(reportProps: ReportProps): Promise<any>;
8
+ flush(): Promise<any>;
9
+ updateDefaults(params: LogParams): this;
10
+ }
11
+ interface LogParams {
12
+ [key: string]: any;
13
+ }
14
+ interface LogOptions {
15
+ endpoint?: string;
16
+ useBatch?: number | boolean;
17
+ category?: EventCategories;
18
+ }
19
+ interface ReportProps {
20
+ evid: number;
21
+ src: number;
22
+ endpoint: string;
23
+ params: LogParams;
24
+ }
25
+ declare enum EventCategories {
26
+ Essential = "essential",
27
+ Functional = "functional",
28
+ Analytics = "analytics"
29
+ }
30
+
31
+ declare class ReadOnlyExperiments {
32
+ protected experiments: ExperimentsBag;
33
+ constructor(options: ReadOnlyExperimentsOptions);
34
+ get(key: string): any;
35
+ enabled(key: string): boolean;
36
+ pending(): boolean;
37
+ ready(): Promise<any>;
38
+ all(): ExperimentsBag;
39
+ }
40
+ interface ExperimentsBag {
41
+ [key: string]: string | boolean;
42
+ }
43
+ interface ReadOnlyExperimentsOptions {
44
+ experiments?: ExperimentsBag;
45
+ }
46
+
47
+ type Conductor = {
48
+ isFeatureOn: (featureName: string) => boolean;
49
+ getABTestVariant: (abTestName: string) => 'a' | 'b' | 'c' | 'd' | 'e';
50
+ };
51
+
4
52
  type HostModule<T, H extends Host> = {
5
53
  __type: 'host';
6
54
  create(host: H): T;
@@ -27,6 +75,21 @@ type Host<Environment = unknown> = {
27
75
  * Optional function to get a monitoring client
28
76
  */
29
77
  getMonitoringClient?: () => MonitoringClient;
78
+ /**
79
+ * Optional function to get a bi logger
80
+ * @internal
81
+ */
82
+ getBiLogger?: () => BiLogger;
83
+ /**
84
+ * Optional function to get petri experiments
85
+ * @internal
86
+ */
87
+ getPetriExperimentsClient?: () => ReadOnlyExperiments;
88
+ /**
89
+ * Optional function to get conductor experiments
90
+ * @internal
91
+ */
92
+ getConductorClient?: () => Conductor;
30
93
  /**
31
94
  * Possible data to be provided by every host, for cross cutting concerns
32
95
  * like internationalization, billing, etc.
@@ -1,6 +1,54 @@
1
1
  import { MonitoringClient } from '@wix/monitoring-types';
2
2
  import { ConditionalExcept, EmptyObject, Simplify, Paths, SetRequiredDeep } from 'type-fest';
3
3
 
4
+ interface BiLogger {
5
+ log(params: LogParams, context?: LogOptions): Promise<any>;
6
+ log(eventName: string, params: LogParams, context?: LogOptions): Promise<any>;
7
+ report(reportProps: ReportProps): Promise<any>;
8
+ flush(): Promise<any>;
9
+ updateDefaults(params: LogParams): this;
10
+ }
11
+ interface LogParams {
12
+ [key: string]: any;
13
+ }
14
+ interface LogOptions {
15
+ endpoint?: string;
16
+ useBatch?: number | boolean;
17
+ category?: EventCategories;
18
+ }
19
+ interface ReportProps {
20
+ evid: number;
21
+ src: number;
22
+ endpoint: string;
23
+ params: LogParams;
24
+ }
25
+ declare enum EventCategories {
26
+ Essential = "essential",
27
+ Functional = "functional",
28
+ Analytics = "analytics"
29
+ }
30
+
31
+ declare class ReadOnlyExperiments {
32
+ protected experiments: ExperimentsBag;
33
+ constructor(options: ReadOnlyExperimentsOptions);
34
+ get(key: string): any;
35
+ enabled(key: string): boolean;
36
+ pending(): boolean;
37
+ ready(): Promise<any>;
38
+ all(): ExperimentsBag;
39
+ }
40
+ interface ExperimentsBag {
41
+ [key: string]: string | boolean;
42
+ }
43
+ interface ReadOnlyExperimentsOptions {
44
+ experiments?: ExperimentsBag;
45
+ }
46
+
47
+ type Conductor = {
48
+ isFeatureOn: (featureName: string) => boolean;
49
+ getABTestVariant: (abTestName: string) => 'a' | 'b' | 'c' | 'd' | 'e';
50
+ };
51
+
4
52
  type HostModule<T, H extends Host> = {
5
53
  __type: 'host';
6
54
  create(host: H): T;
@@ -27,6 +75,21 @@ type Host<Environment = unknown> = {
27
75
  * Optional function to get a monitoring client
28
76
  */
29
77
  getMonitoringClient?: () => MonitoringClient;
78
+ /**
79
+ * Optional function to get a bi logger
80
+ * @internal
81
+ */
82
+ getBiLogger?: () => BiLogger;
83
+ /**
84
+ * Optional function to get petri experiments
85
+ * @internal
86
+ */
87
+ getPetriExperimentsClient?: () => ReadOnlyExperiments;
88
+ /**
89
+ * Optional function to get conductor experiments
90
+ * @internal
91
+ */
92
+ getConductorClient?: () => Conductor;
30
93
  /**
31
94
  * Possible data to be provided by every host, for cross cutting concerns
32
95
  * like internationalization, billing, etc.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-types",
3
- "version": "1.13.11",
3
+ "version": "1.13.13",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -33,7 +33,7 @@
33
33
  "type-fest": "^4.40.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@types/node": "^20.17.30",
36
+ "@types/node": "^20.17.31",
37
37
  "eslint": "^8.57.1",
38
38
  "eslint-config-sdk": "0.0.0",
39
39
  "tsup": "^7.3.0",
@@ -59,5 +59,5 @@
59
59
  "wallaby": {
60
60
  "autoDetect": true
61
61
  },
62
- "falconPackageHash": "0c110c68c82059edb9b2b53f65cb4b1db622090d2045ae67ca04468b"
62
+ "falconPackageHash": "6d0bd6b55864debf549a0f6e0ea8aabdf9747f35cf33cfa81b7af5ab"
63
63
  }