@constructor-io/constructorio-client-javascript 2.34.2 → 2.34.4
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/lib/modules/quizzes.js +4 -4
- package/lib/types/autocomplete.d.ts +46 -54
- package/lib/types/browse.d.ts +121 -113
- package/lib/types/constructorio.d.ts +23 -22
- package/lib/types/event-dispatcher.d.ts +15 -9
- package/lib/types/index.d.ts +182 -0
- package/lib/types/quizzes.d.ts +85 -0
- package/lib/types/recommendations.d.ts +54 -63
- package/lib/types/search.d.ts +87 -93
- package/lib/types/tracker.d.ts +172 -159
- package/package.json +5 -2
package/lib/types/tracker.d.ts
CHANGED
|
@@ -1,162 +1,175 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import RequestQueue = require(
|
|
1
|
+
import EventEmitter = require('events');
|
|
2
|
+
import { ConstructorClientOptions, NetworkParameters } from '.';
|
|
3
|
+
import RequestQueue = require('../utils/request-queue');
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export default Tracker;
|
|
6
6
|
|
|
7
|
-
/******************
|
|
8
|
-
*
|
|
9
|
-
* Tracker
|
|
10
|
-
*
|
|
11
|
-
*****************/
|
|
12
7
|
declare class Tracker {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
8
|
+
constructor(options: ConstructorClientOptions);
|
|
9
|
+
|
|
10
|
+
private options: ConstructorClientOptions;
|
|
11
|
+
|
|
12
|
+
private eventemitter: EventEmitter;
|
|
13
|
+
|
|
14
|
+
private requests: RequestQueue;
|
|
15
|
+
|
|
16
|
+
trackSessionStart(networkParameters?: NetworkParameters): true | Error;
|
|
17
|
+
|
|
18
|
+
trackInputFocus(networkParameters?: NetworkParameters): true | Error;
|
|
19
|
+
|
|
20
|
+
trackItemDetailLoad(
|
|
21
|
+
parameters: {
|
|
22
|
+
item_name: string;
|
|
23
|
+
item_id: string;
|
|
24
|
+
variation_id?: string;
|
|
25
|
+
},
|
|
26
|
+
networkParameters?: NetworkParameters
|
|
27
|
+
): true | Error;
|
|
28
|
+
|
|
29
|
+
trackAutocompleteSelect(
|
|
30
|
+
term: string,
|
|
31
|
+
parameters: {
|
|
32
|
+
original_query: string;
|
|
33
|
+
section: string;
|
|
34
|
+
tr?: string;
|
|
35
|
+
group_id?: string;
|
|
36
|
+
display_name?: string;
|
|
37
|
+
},
|
|
38
|
+
networkParameters?: NetworkParameters
|
|
39
|
+
): true | Error;
|
|
40
|
+
|
|
41
|
+
trackSearchSubmit(
|
|
42
|
+
term: string,
|
|
43
|
+
parameters: {
|
|
44
|
+
original_query: string;
|
|
45
|
+
group_id?: string;
|
|
46
|
+
display_name?: string;
|
|
47
|
+
},
|
|
48
|
+
networkParameters?: NetworkParameters
|
|
49
|
+
): true | Error;
|
|
50
|
+
|
|
51
|
+
trackSearchResultsLoaded(
|
|
52
|
+
term: string,
|
|
53
|
+
parameters: {
|
|
54
|
+
num_results: number;
|
|
55
|
+
item_ids?: string[];
|
|
56
|
+
},
|
|
57
|
+
networkParameters?: NetworkParameters
|
|
58
|
+
): true | Error;
|
|
59
|
+
|
|
60
|
+
trackSearchResultClick(
|
|
61
|
+
term: string,
|
|
62
|
+
parameters: {
|
|
63
|
+
item_name: string;
|
|
64
|
+
item_id: string;
|
|
65
|
+
variation_id?: string;
|
|
66
|
+
result_id?: string;
|
|
67
|
+
item_is_convertible?: string;
|
|
68
|
+
section?: string;
|
|
69
|
+
},
|
|
70
|
+
networkParameters?: NetworkParameters
|
|
71
|
+
): true | Error;
|
|
72
|
+
|
|
73
|
+
trackConversion(
|
|
74
|
+
term?: string,
|
|
75
|
+
parameters: {
|
|
76
|
+
item_id: string;
|
|
77
|
+
revenue?: number;
|
|
78
|
+
item_name?: string;
|
|
79
|
+
variation_id?: string;
|
|
80
|
+
type?: string;
|
|
81
|
+
is_custom_type?: boolean;
|
|
82
|
+
display_name?: string;
|
|
83
|
+
result_id?: string;
|
|
84
|
+
section?: string;
|
|
85
|
+
},
|
|
86
|
+
networkParameters?: NetworkParameters
|
|
87
|
+
): true | Error;
|
|
88
|
+
|
|
89
|
+
trackPurchase(
|
|
90
|
+
parameters: {
|
|
91
|
+
items: object[];
|
|
92
|
+
revenue: number;
|
|
93
|
+
order_id?: string;
|
|
94
|
+
section?: string;
|
|
95
|
+
},
|
|
96
|
+
networkParameters?: NetworkParameters
|
|
97
|
+
): true | Error;
|
|
98
|
+
|
|
99
|
+
trackRecommendationView(
|
|
100
|
+
parameters: {
|
|
101
|
+
url: string;
|
|
102
|
+
pod_id: string;
|
|
103
|
+
num_results_viewed: number;
|
|
104
|
+
items?: object[];
|
|
105
|
+
result_count?: number;
|
|
106
|
+
result_page?: number;
|
|
107
|
+
result_id?: string;
|
|
108
|
+
section?: string;
|
|
109
|
+
},
|
|
110
|
+
networkParameters?: NetworkParameters
|
|
111
|
+
): true | Error;
|
|
112
|
+
|
|
113
|
+
trackRecommendationClick(
|
|
114
|
+
parameters: {
|
|
115
|
+
pod_id: string;
|
|
116
|
+
strategy_id: string;
|
|
117
|
+
item_id: string;
|
|
118
|
+
item_name: string;
|
|
119
|
+
variation_id?: string;
|
|
120
|
+
section?: string;
|
|
121
|
+
result_id?: string;
|
|
122
|
+
result_count?: number;
|
|
123
|
+
result_page?: number;
|
|
124
|
+
result_position_on_page?: number;
|
|
125
|
+
num_results_per_page?: number;
|
|
126
|
+
},
|
|
127
|
+
networkParameters?: NetworkParameters
|
|
128
|
+
): true | Error;
|
|
129
|
+
|
|
130
|
+
trackBrowseResultsLoaded(
|
|
131
|
+
parameters: {
|
|
132
|
+
url: string;
|
|
133
|
+
filter_name: string;
|
|
134
|
+
filter_value: string;
|
|
135
|
+
section?: string;
|
|
136
|
+
result_count?: number;
|
|
137
|
+
result_page?: number;
|
|
138
|
+
result_id?: string;
|
|
139
|
+
selected_filters?: object;
|
|
140
|
+
sort_order?: string;
|
|
141
|
+
sort_by?: string;
|
|
142
|
+
items?: object[];
|
|
143
|
+
},
|
|
144
|
+
networkParameters?: NetworkParameters
|
|
145
|
+
): true | Error;
|
|
146
|
+
|
|
147
|
+
trackBrowseResultClick(
|
|
148
|
+
parameters: {
|
|
149
|
+
filter_name: string;
|
|
150
|
+
filter_value: string;
|
|
151
|
+
item_id: string;
|
|
152
|
+
section?: string;
|
|
153
|
+
variation_id?: string;
|
|
154
|
+
result_id?: string;
|
|
155
|
+
result_count?: number;
|
|
156
|
+
result_page?: number;
|
|
157
|
+
result_position_on_page?: number;
|
|
158
|
+
num_results_per_page?: number;
|
|
159
|
+
selected_filters?: object;
|
|
160
|
+
},
|
|
161
|
+
networkParameters?: NetworkParameters
|
|
162
|
+
): true | Error;
|
|
163
|
+
|
|
164
|
+
trackGenericResultClick(
|
|
165
|
+
parameters: {
|
|
166
|
+
item_id: string;
|
|
167
|
+
item_name?: string;
|
|
168
|
+
variation_id?: string;
|
|
169
|
+
section?: string;
|
|
170
|
+
},
|
|
171
|
+
networkParameters?: NetworkParameters
|
|
172
|
+
): true | Error;
|
|
173
|
+
|
|
174
|
+
on(messageType: string, callback: Function): true | Error;
|
|
175
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructor-io/constructorio-client-javascript",
|
|
3
|
-
"version": "2.34.
|
|
3
|
+
"version": "2.34.4",
|
|
4
4
|
"description": "Constructor.io JavaScript client",
|
|
5
5
|
"main": "lib/constructorio.js",
|
|
6
6
|
"types": "lib/types/constructorio.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"clean": "sudo rm -rf node_modules package-lock.json",
|
|
9
9
|
"version": "chmod +x ./scripts/verify-node-version.sh && ./scripts/verify-node-version.sh && npm run docs && git add ./docs/* && npm run bundle && git add -A ./dist",
|
|
10
10
|
"check-lisc": "license-checker --production --onlyAllow 'Apache-2.0;BSD-3-Clause;MIT'",
|
|
11
|
-
"lint": "eslint 'src/**/*.js' 'spec/**/*.js'",
|
|
11
|
+
"lint": "eslint 'src/**/*.js' 'spec/**/*.js' 'src/**/*.d.ts'",
|
|
12
12
|
"test": "npm run compile && mkdir -p test && cp -rf lib/* test && mocha ./spec/*",
|
|
13
13
|
"test:types": "tsd .",
|
|
14
14
|
"test:parallel": "npm run compile && mkdir -p test && cp -rf lib/* test && mocha --parallel ./spec/*",
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
"@babel/preset-env": "^7.15.8",
|
|
48
48
|
"@babel/register": "^7.15.3",
|
|
49
49
|
"@cspell/eslint-plugin": "^6.8.2",
|
|
50
|
+
"@types/events": "^3.0.0",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
|
52
|
+
"@typescript-eslint/parser": "^5.48.1",
|
|
50
53
|
"chai": "^4.2.0",
|
|
51
54
|
"chai-as-promised": "^7.1.1",
|
|
52
55
|
"dotenv": "^8.6.0",
|