@wix/sdk-types 1.13.11 → 1.13.12
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/internal/build/browser/index.d.mts +110 -0
- package/internal/build/index.d.mts +110 -0
- package/internal/build/index.d.ts +110 -0
- package/package.json +2 -2
|
@@ -1,6 +1,101 @@
|
|
|
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
|
+
declare class Experiments extends ReadOnlyExperiments {
|
|
41
|
+
private readonly loaders;
|
|
42
|
+
private readonly baseUrl;
|
|
43
|
+
private requestContext;
|
|
44
|
+
readonly useNewApi: boolean;
|
|
45
|
+
private onError;
|
|
46
|
+
constructor(obj?: ExperimentsProps);
|
|
47
|
+
add(obj: ExperimentsBag): void;
|
|
48
|
+
private _addLoader;
|
|
49
|
+
private _getUrlWithFallback;
|
|
50
|
+
load(scope: string): Promise<void>;
|
|
51
|
+
conduct(spec: string, fallbackValue?: string): Promise<string>;
|
|
52
|
+
pending(): boolean;
|
|
53
|
+
ready(): Promise<any>;
|
|
54
|
+
_addConductResult(spec: string, conductResponse: string): Promise<string>;
|
|
55
|
+
}
|
|
56
|
+
interface ExperimentsBag {
|
|
57
|
+
[key: string]: string | boolean;
|
|
58
|
+
}
|
|
59
|
+
interface ReadOnlyExperimentsOptions {
|
|
60
|
+
experiments?: ExperimentsBag;
|
|
61
|
+
}
|
|
62
|
+
interface ExperimentsProps extends ReadOnlyExperimentsOptions {
|
|
63
|
+
useNewApi?: boolean;
|
|
64
|
+
baseUrl?: string;
|
|
65
|
+
scope?: string;
|
|
66
|
+
scopes?: string[];
|
|
67
|
+
requestContext?: RequestContext$1;
|
|
68
|
+
onError?: (error: Error) => void;
|
|
69
|
+
}
|
|
70
|
+
type RequestContext$1 = RequestContextMetasite & OneOf<RequestContextOwner, RequestContextVisitors>;
|
|
71
|
+
interface RequestContextMetasite {
|
|
72
|
+
overrideCriteria?: {
|
|
73
|
+
entityId: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
interface RequestContextOwner {
|
|
77
|
+
forSiteOwner?: {
|
|
78
|
+
loggedInUserId: string;
|
|
79
|
+
siteOwnerId: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
interface RequestContextVisitors {
|
|
83
|
+
forSiteVisitors?: {
|
|
84
|
+
visitorId: string;
|
|
85
|
+
siteOwnerId: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
type OneOf<T1, T2> = ({
|
|
89
|
+
[P in keyof T1]?: never;
|
|
90
|
+
} & T2) | ({
|
|
91
|
+
[P in keyof T2]?: never;
|
|
92
|
+
} & T1);
|
|
93
|
+
|
|
94
|
+
type Conductor = {
|
|
95
|
+
isFeatureOn: (featureName: string) => boolean;
|
|
96
|
+
getABTestVariant: (abTestName: string) => 'a' | 'b' | 'c' | 'd' | 'e';
|
|
97
|
+
};
|
|
98
|
+
|
|
4
99
|
type HostModule<T, H extends Host> = {
|
|
5
100
|
__type: 'host';
|
|
6
101
|
create(host: H): T;
|
|
@@ -27,6 +122,21 @@ type Host<Environment = unknown> = {
|
|
|
27
122
|
* Optional function to get a monitoring client
|
|
28
123
|
*/
|
|
29
124
|
getMonitoringClient?: () => MonitoringClient;
|
|
125
|
+
/**
|
|
126
|
+
* Optional function to get a bi logger
|
|
127
|
+
* @internal
|
|
128
|
+
*/
|
|
129
|
+
getBiLogger?: () => BiLogger;
|
|
130
|
+
/**
|
|
131
|
+
* Optional function to get petri experiments
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
getPetriExperimentsClient?: () => Experiments;
|
|
135
|
+
/**
|
|
136
|
+
* Optional function to get conductor experiments
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
getConductorClient?: () => Conductor;
|
|
30
140
|
/**
|
|
31
141
|
* Possible data to be provided by every host, for cross cutting concerns
|
|
32
142
|
* like internationalization, billing, etc.
|
|
@@ -1,6 +1,101 @@
|
|
|
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
|
+
declare class Experiments extends ReadOnlyExperiments {
|
|
41
|
+
private readonly loaders;
|
|
42
|
+
private readonly baseUrl;
|
|
43
|
+
private requestContext;
|
|
44
|
+
readonly useNewApi: boolean;
|
|
45
|
+
private onError;
|
|
46
|
+
constructor(obj?: ExperimentsProps);
|
|
47
|
+
add(obj: ExperimentsBag): void;
|
|
48
|
+
private _addLoader;
|
|
49
|
+
private _getUrlWithFallback;
|
|
50
|
+
load(scope: string): Promise<void>;
|
|
51
|
+
conduct(spec: string, fallbackValue?: string): Promise<string>;
|
|
52
|
+
pending(): boolean;
|
|
53
|
+
ready(): Promise<any>;
|
|
54
|
+
_addConductResult(spec: string, conductResponse: string): Promise<string>;
|
|
55
|
+
}
|
|
56
|
+
interface ExperimentsBag {
|
|
57
|
+
[key: string]: string | boolean;
|
|
58
|
+
}
|
|
59
|
+
interface ReadOnlyExperimentsOptions {
|
|
60
|
+
experiments?: ExperimentsBag;
|
|
61
|
+
}
|
|
62
|
+
interface ExperimentsProps extends ReadOnlyExperimentsOptions {
|
|
63
|
+
useNewApi?: boolean;
|
|
64
|
+
baseUrl?: string;
|
|
65
|
+
scope?: string;
|
|
66
|
+
scopes?: string[];
|
|
67
|
+
requestContext?: RequestContext$1;
|
|
68
|
+
onError?: (error: Error) => void;
|
|
69
|
+
}
|
|
70
|
+
type RequestContext$1 = RequestContextMetasite & OneOf<RequestContextOwner, RequestContextVisitors>;
|
|
71
|
+
interface RequestContextMetasite {
|
|
72
|
+
overrideCriteria?: {
|
|
73
|
+
entityId: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
interface RequestContextOwner {
|
|
77
|
+
forSiteOwner?: {
|
|
78
|
+
loggedInUserId: string;
|
|
79
|
+
siteOwnerId: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
interface RequestContextVisitors {
|
|
83
|
+
forSiteVisitors?: {
|
|
84
|
+
visitorId: string;
|
|
85
|
+
siteOwnerId: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
type OneOf<T1, T2> = ({
|
|
89
|
+
[P in keyof T1]?: never;
|
|
90
|
+
} & T2) | ({
|
|
91
|
+
[P in keyof T2]?: never;
|
|
92
|
+
} & T1);
|
|
93
|
+
|
|
94
|
+
type Conductor = {
|
|
95
|
+
isFeatureOn: (featureName: string) => boolean;
|
|
96
|
+
getABTestVariant: (abTestName: string) => 'a' | 'b' | 'c' | 'd' | 'e';
|
|
97
|
+
};
|
|
98
|
+
|
|
4
99
|
type HostModule<T, H extends Host> = {
|
|
5
100
|
__type: 'host';
|
|
6
101
|
create(host: H): T;
|
|
@@ -27,6 +122,21 @@ type Host<Environment = unknown> = {
|
|
|
27
122
|
* Optional function to get a monitoring client
|
|
28
123
|
*/
|
|
29
124
|
getMonitoringClient?: () => MonitoringClient;
|
|
125
|
+
/**
|
|
126
|
+
* Optional function to get a bi logger
|
|
127
|
+
* @internal
|
|
128
|
+
*/
|
|
129
|
+
getBiLogger?: () => BiLogger;
|
|
130
|
+
/**
|
|
131
|
+
* Optional function to get petri experiments
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
getPetriExperimentsClient?: () => Experiments;
|
|
135
|
+
/**
|
|
136
|
+
* Optional function to get conductor experiments
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
getConductorClient?: () => Conductor;
|
|
30
140
|
/**
|
|
31
141
|
* Possible data to be provided by every host, for cross cutting concerns
|
|
32
142
|
* like internationalization, billing, etc.
|
|
@@ -1,6 +1,101 @@
|
|
|
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
|
+
declare class Experiments extends ReadOnlyExperiments {
|
|
41
|
+
private readonly loaders;
|
|
42
|
+
private readonly baseUrl;
|
|
43
|
+
private requestContext;
|
|
44
|
+
readonly useNewApi: boolean;
|
|
45
|
+
private onError;
|
|
46
|
+
constructor(obj?: ExperimentsProps);
|
|
47
|
+
add(obj: ExperimentsBag): void;
|
|
48
|
+
private _addLoader;
|
|
49
|
+
private _getUrlWithFallback;
|
|
50
|
+
load(scope: string): Promise<void>;
|
|
51
|
+
conduct(spec: string, fallbackValue?: string): Promise<string>;
|
|
52
|
+
pending(): boolean;
|
|
53
|
+
ready(): Promise<any>;
|
|
54
|
+
_addConductResult(spec: string, conductResponse: string): Promise<string>;
|
|
55
|
+
}
|
|
56
|
+
interface ExperimentsBag {
|
|
57
|
+
[key: string]: string | boolean;
|
|
58
|
+
}
|
|
59
|
+
interface ReadOnlyExperimentsOptions {
|
|
60
|
+
experiments?: ExperimentsBag;
|
|
61
|
+
}
|
|
62
|
+
interface ExperimentsProps extends ReadOnlyExperimentsOptions {
|
|
63
|
+
useNewApi?: boolean;
|
|
64
|
+
baseUrl?: string;
|
|
65
|
+
scope?: string;
|
|
66
|
+
scopes?: string[];
|
|
67
|
+
requestContext?: RequestContext$1;
|
|
68
|
+
onError?: (error: Error) => void;
|
|
69
|
+
}
|
|
70
|
+
type RequestContext$1 = RequestContextMetasite & OneOf<RequestContextOwner, RequestContextVisitors>;
|
|
71
|
+
interface RequestContextMetasite {
|
|
72
|
+
overrideCriteria?: {
|
|
73
|
+
entityId: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
interface RequestContextOwner {
|
|
77
|
+
forSiteOwner?: {
|
|
78
|
+
loggedInUserId: string;
|
|
79
|
+
siteOwnerId: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
interface RequestContextVisitors {
|
|
83
|
+
forSiteVisitors?: {
|
|
84
|
+
visitorId: string;
|
|
85
|
+
siteOwnerId: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
type OneOf<T1, T2> = ({
|
|
89
|
+
[P in keyof T1]?: never;
|
|
90
|
+
} & T2) | ({
|
|
91
|
+
[P in keyof T2]?: never;
|
|
92
|
+
} & T1);
|
|
93
|
+
|
|
94
|
+
type Conductor = {
|
|
95
|
+
isFeatureOn: (featureName: string) => boolean;
|
|
96
|
+
getABTestVariant: (abTestName: string) => 'a' | 'b' | 'c' | 'd' | 'e';
|
|
97
|
+
};
|
|
98
|
+
|
|
4
99
|
type HostModule<T, H extends Host> = {
|
|
5
100
|
__type: 'host';
|
|
6
101
|
create(host: H): T;
|
|
@@ -27,6 +122,21 @@ type Host<Environment = unknown> = {
|
|
|
27
122
|
* Optional function to get a monitoring client
|
|
28
123
|
*/
|
|
29
124
|
getMonitoringClient?: () => MonitoringClient;
|
|
125
|
+
/**
|
|
126
|
+
* Optional function to get a bi logger
|
|
127
|
+
* @internal
|
|
128
|
+
*/
|
|
129
|
+
getBiLogger?: () => BiLogger;
|
|
130
|
+
/**
|
|
131
|
+
* Optional function to get petri experiments
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
getPetriExperimentsClient?: () => Experiments;
|
|
135
|
+
/**
|
|
136
|
+
* Optional function to get conductor experiments
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
getConductorClient?: () => Conductor;
|
|
30
140
|
/**
|
|
31
141
|
* Possible data to be provided by every host, for cross cutting concerns
|
|
32
142
|
* like internationalization, billing, etc.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/sdk-types",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ronny Ringel",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"wallaby": {
|
|
60
60
|
"autoDetect": true
|
|
61
61
|
},
|
|
62
|
-
"falconPackageHash": "
|
|
62
|
+
"falconPackageHash": "30c9904511db4ec394c30380f2bf0130223ee527b2e35e0f4963f149"
|
|
63
63
|
}
|