@constructor-io/constructorio-client-javascript 2.34.1 → 2.34.3
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/constructorio.js +4 -1
- package/lib/modules/quizzes.js +7 -7
- package/lib/types/autocomplete.d.ts +46 -54
- package/lib/types/browse.d.ts +120 -113
- package/lib/types/constructorio.d.ts +23 -22
- package/lib/types/event-dispatcher.d.ts +15 -9
- package/lib/types/index.d.ts +154 -0
- package/lib/types/quizzes.d.ts +85 -0
- package/lib/types/recommendations.d.ts +54 -63
- package/lib/types/search.d.ts +85 -93
- package/lib/types/tracker.d.ts +172 -159
- package/package.json +5 -2
package/lib/constructorio.js
CHANGED
|
@@ -6,7 +6,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
6
6
|
|
|
7
7
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
8
|
|
|
9
|
-
/* eslint-disable camelcase, no-unneeded-ternary, max-len */
|
|
9
|
+
/* eslint-disable camelcase, no-unneeded-ternary, max-len, complexity */
|
|
10
10
|
var ConstructorioID = require('@constructor-io/constructorio-id');
|
|
11
11
|
|
|
12
12
|
var fetchPonyfill = require('fetch-ponyfill'); // Modules
|
|
@@ -56,6 +56,7 @@ var ConstructorIO = /*#__PURE__*/function () {
|
|
|
56
56
|
* @param {object} parameters - Parameters for client instantiation
|
|
57
57
|
* @param {string} parameters.apiKey - Constructor.io API key
|
|
58
58
|
* @param {string} [parameters.serviceUrl='https://ac.cnstrc.com'] - API URL endpoint
|
|
59
|
+
* @param {string} [parameters.quizzesServiceUrl='https://quizzes.cnstrc.com'] - Quizzes API URL endpoint
|
|
59
60
|
* @param {array} [parameters.segments] - User segments
|
|
60
61
|
* @param {object} [parameters.testCells] - User test cells
|
|
61
62
|
* @param {string} [parameters.clientId] - Client ID, defaults to value supplied by 'constructorio-id' module
|
|
@@ -85,6 +86,7 @@ var ConstructorIO = /*#__PURE__*/function () {
|
|
|
85
86
|
var apiKey = options.apiKey,
|
|
86
87
|
versionFromOptions = options.version,
|
|
87
88
|
serviceUrl = options.serviceUrl,
|
|
89
|
+
quizzesServiceUrl = options.quizzesServiceUrl,
|
|
88
90
|
segments = options.segments,
|
|
89
91
|
testCells = options.testCells,
|
|
90
92
|
clientId = options.clientId,
|
|
@@ -128,6 +130,7 @@ var ConstructorIO = /*#__PURE__*/function () {
|
|
|
128
130
|
apiKey: apiKey,
|
|
129
131
|
version: versionFromOptions || versionFromGlobal || computePackageVersion(),
|
|
130
132
|
serviceUrl: serviceUrl && serviceUrl.replace(/\/$/, '') || 'https://ac.cnstrc.com',
|
|
133
|
+
quizzesServiceUrl: quizzesServiceUrl && quizzesServiceUrl.replace(/\/$/, '') || 'https://quizzes.cnstrc.com',
|
|
131
134
|
sessionId: sessionId || session_id,
|
|
132
135
|
clientId: clientId || client_id,
|
|
133
136
|
userId: userId,
|
package/lib/modules/quizzes.js
CHANGED
|
@@ -22,8 +22,8 @@ function createQuizUrl(quizId, parameters, options, path) {
|
|
|
22
22
|
sessionId = options.sessionId,
|
|
23
23
|
segments = options.segments,
|
|
24
24
|
userId = options.userId,
|
|
25
|
-
version = options.version
|
|
26
|
-
|
|
25
|
+
version = options.version,
|
|
26
|
+
quizzesServiceUrl = options.quizzesServiceUrl;
|
|
27
27
|
var queryParams = {
|
|
28
28
|
c: version
|
|
29
29
|
};
|
|
@@ -77,7 +77,7 @@ function createQuizUrl(quizId, parameters, options, path) {
|
|
|
77
77
|
queryParams._dt = Date.now();
|
|
78
78
|
queryParams = helpers.cleanParams(queryParams);
|
|
79
79
|
var queryString = helpers.stringify(queryParams);
|
|
80
|
-
return "".concat(
|
|
80
|
+
return "".concat(quizzesServiceUrl, "/v1/quizzes/").concat(encodeURIComponent(quizId), "/").concat(encodeURIComponent(path), "/?").concat(queryString).concat(answersParamString);
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* Interface to quiz related API calls
|
|
@@ -119,7 +119,7 @@ var Quizzes = /*#__PURE__*/function () {
|
|
|
119
119
|
|
|
120
120
|
(0, _createClass2["default"])(Quizzes, [{
|
|
121
121
|
key: "getQuizNextQuestion",
|
|
122
|
-
value: function getQuizNextQuestion(
|
|
122
|
+
value: function getQuizNextQuestion(id, parameters) {
|
|
123
123
|
var _this = this;
|
|
124
124
|
|
|
125
125
|
var networkParameters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -129,7 +129,7 @@ var Quizzes = /*#__PURE__*/function () {
|
|
|
129
129
|
var signal = controller.signal;
|
|
130
130
|
|
|
131
131
|
try {
|
|
132
|
-
requestUrl = createQuizUrl(
|
|
132
|
+
requestUrl = createQuizUrl(id, parameters, this.options, 'next');
|
|
133
133
|
} catch (e) {
|
|
134
134
|
return Promise.reject(e);
|
|
135
135
|
} // Handle network timeout if specified
|
|
@@ -178,7 +178,7 @@ var Quizzes = /*#__PURE__*/function () {
|
|
|
178
178
|
|
|
179
179
|
}, {
|
|
180
180
|
key: "getQuizResults",
|
|
181
|
-
value: function getQuizResults(
|
|
181
|
+
value: function getQuizResults(id, parameters) {
|
|
182
182
|
var _this2 = this;
|
|
183
183
|
|
|
184
184
|
var networkParameters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -188,7 +188,7 @@ var Quizzes = /*#__PURE__*/function () {
|
|
|
188
188
|
var signal = controller.signal;
|
|
189
189
|
|
|
190
190
|
try {
|
|
191
|
-
requestUrl = createQuizUrl(
|
|
191
|
+
requestUrl = createQuizUrl(id, parameters, this.options, 'finalize');
|
|
192
192
|
} catch (e) {
|
|
193
193
|
return Promise.reject(e);
|
|
194
194
|
} // Handle network timeout if specified
|
|
@@ -1,67 +1,59 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
filters: Record<string, any>;
|
|
18
|
-
resultsPerSection: Record<string, number>;
|
|
19
|
-
hiddenFields: string[];
|
|
20
|
-
variationsMap: Record<string, any>;
|
|
2
|
+
ConstructorClientOptions,
|
|
3
|
+
NetworkParameters,
|
|
4
|
+
RequestFeature,
|
|
5
|
+
RequestFeatureVariant,
|
|
6
|
+
} from '.';
|
|
7
|
+
import EventDispatcher from './event-dispatcher';
|
|
8
|
+
|
|
9
|
+
export default Autocomplete;
|
|
10
|
+
|
|
11
|
+
export interface IAutocompleteParameters {
|
|
12
|
+
numResults?: number;
|
|
13
|
+
filters?: Record<string, any>;
|
|
14
|
+
resultsPerSection?: Record<string, number>;
|
|
15
|
+
hiddenFields?: string[];
|
|
16
|
+
variationsMap?: Record<string, any>;
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
declare class Autocomplete {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
constructor(options: ConstructorClientOptions);
|
|
21
|
+
|
|
22
|
+
options: ConstructorClientOptions;
|
|
23
|
+
|
|
24
|
+
eventDispatcher: EventDispatcher;
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
): Promise<Autocomplete.AutocompleteResponse>;
|
|
26
|
+
getAutocompleteResults(
|
|
27
|
+
query: string,
|
|
28
|
+
parameters?: IAutocompleteParameters,
|
|
29
|
+
networkParameters?: NetworkParameters
|
|
30
|
+
): Promise<AutocompleteResponse>;
|
|
35
31
|
}
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
request: Partial<Request>;
|
|
45
|
-
sections: Record<string, Section>;
|
|
46
|
-
result_id: string;
|
|
47
|
-
}
|
|
33
|
+
/** *********
|
|
34
|
+
* Autocomplete results returned from server
|
|
35
|
+
********** */
|
|
36
|
+
export interface AutocompleteResponse extends Record<string, any> {
|
|
37
|
+
request: Partial<AutocompleteRequestType>;
|
|
38
|
+
sections: Record<string, Section>;
|
|
39
|
+
result_id: string;
|
|
48
40
|
}
|
|
49
41
|
|
|
50
|
-
interface
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
export interface AutocompleteRequestType extends Record<string, any> {
|
|
43
|
+
num_results: number;
|
|
44
|
+
term: string;
|
|
45
|
+
query: string;
|
|
46
|
+
features: Partial<RequestFeature>;
|
|
47
|
+
feature_variants: Partial<RequestFeatureVariant>;
|
|
48
|
+
searchandized_items: Record<string, any>;
|
|
57
49
|
}
|
|
58
50
|
|
|
59
|
-
type Section = Partial<SectionItem>[]
|
|
51
|
+
export type Section = Partial<SectionItem>[];
|
|
60
52
|
|
|
61
|
-
interface SectionItem extends Record<string, any> {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
export interface SectionItem extends Record<string, any> {
|
|
54
|
+
data: Record<string, any>;
|
|
55
|
+
is_slotted: boolean;
|
|
56
|
+
labels: Record<string, any>;
|
|
57
|
+
matched_terms: string[];
|
|
58
|
+
value: string;
|
|
67
59
|
}
|
package/lib/types/browse.d.ts
CHANGED
|
@@ -1,133 +1,140 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Collection,
|
|
3
|
+
ConstructorClientOptions,
|
|
4
|
+
Facet,
|
|
5
|
+
Feature,
|
|
6
|
+
Group,
|
|
7
|
+
NetworkParameters,
|
|
8
|
+
RequestFeature,
|
|
9
|
+
RequestFeatureVariant,
|
|
10
|
+
ResultSources,
|
|
11
|
+
SortOption,
|
|
12
|
+
} from '.';
|
|
13
|
+
import EventDispatcher from './event-dispatcher';
|
|
3
14
|
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* Browse
|
|
7
|
-
*
|
|
8
|
-
*********/
|
|
9
|
-
export = Browse;
|
|
15
|
+
export default Browse;
|
|
10
16
|
|
|
11
|
-
interface IBrowseParameters {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
export interface IBrowseParameters {
|
|
18
|
+
page?: number;
|
|
19
|
+
offset?: number;
|
|
20
|
+
resultsPerPage?: number;
|
|
21
|
+
filters?: Record<string, any>;
|
|
22
|
+
sortBy?: string;
|
|
23
|
+
sortOrder?: string;
|
|
24
|
+
section?: string;
|
|
25
|
+
fmtOptions?: Record<string, any>;
|
|
26
|
+
preFilterExpression: Record<string, any>;
|
|
27
|
+
hiddenFields?: string[];
|
|
28
|
+
hiddenFacets?: string[];
|
|
29
|
+
variationsMap?: Record<string, any>;
|
|
30
|
+
qs?: Record<string, any>;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
declare class Browse {
|
|
28
|
-
|
|
29
|
-
options: ConstructorClientOptions;
|
|
30
|
-
eventDispatcher: EventDispatcher;
|
|
34
|
+
constructor(options: ConstructorClientOptions);
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
filterName: string,
|
|
34
|
-
filterValue: string,
|
|
35
|
-
parameters?: IBrowseParameters,
|
|
36
|
-
networkParameters?: {
|
|
37
|
-
timeout?: number;
|
|
38
|
-
}
|
|
39
|
-
): Promise<Browse.GetBrowseResultsResponse>;
|
|
36
|
+
options: ConstructorClientOptions;
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
itemIds: string[],
|
|
43
|
-
parameters?: Omit<IBrowseParameters, "preFilterExpression" | "preFilterExpression">,
|
|
44
|
-
networkParameters?: {
|
|
45
|
-
timeout?: number;
|
|
46
|
-
}
|
|
47
|
-
): Promise<Browse.GetBrowseResultsForItemIdsResponse>;
|
|
38
|
+
eventDispatcher: EventDispatcher;
|
|
48
39
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
40
|
+
getBrowseResults(
|
|
41
|
+
filterName: string,
|
|
42
|
+
filterValue: string,
|
|
43
|
+
parameters?: IBrowseParameters,
|
|
44
|
+
networkParameters?: NetworkParameters
|
|
45
|
+
): Promise<GetBrowseResultsResponse>;
|
|
55
46
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
): Promise<Browse.GetBrowseFacetsResponse>;
|
|
47
|
+
getBrowseResultsForItemIds(
|
|
48
|
+
itemIds: string[],
|
|
49
|
+
parameters?: Omit<IBrowseParameters, 'preFilterExpression' | 'qs'>,
|
|
50
|
+
networkParameters?: NetworkParameters
|
|
51
|
+
): Promise<GetBrowseResultsForItemIdsResponse>;
|
|
62
52
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
getBrowseGroups(
|
|
54
|
+
parameters?: Pick<IBrowseParameters, 'filters' | 'section' | 'fmtOptions'>,
|
|
55
|
+
networkParameters?: NetworkParameters
|
|
56
|
+
): Promise<GetBrowseGroupsResponse>;
|
|
57
|
+
|
|
58
|
+
getBrowseFacets(
|
|
59
|
+
parameters?: Pick<
|
|
60
|
+
IBrowseParameters,
|
|
61
|
+
'page' | 'offset' | 'section' | 'fmtOptions' | 'resultsPerPage'
|
|
62
|
+
>,
|
|
63
|
+
networkParameters?: NetworkParameters
|
|
64
|
+
): Promise<GetBrowseFacetsResponse>;
|
|
65
|
+
|
|
66
|
+
getBrowseFacetOptions(
|
|
67
|
+
facetName: string,
|
|
68
|
+
parameters?: Pick<IBrowseParameters, 'section' | 'fmtOptions'>,
|
|
69
|
+
networkParameters?: NetworkParameters
|
|
70
|
+
): Promise<GetBrowseFacetOptionsResponse>;
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
*
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
export type GetBrowseGroupsResponse = BrowseResponse<Pick<GetBrowseResultsResponseData, "result_sources" | "groups" | "refined_content">>;
|
|
81
|
-
export type GetBrowseFacetsResponse = BrowseResponse<Pick<GetBrowseResultsResponseData, "facets" | "total_num_results">>;
|
|
82
|
-
export type GetBrowseFacetOptionsResponse = BrowseResponse<Pick<GetBrowseResultsResponseData, "facets">>;
|
|
73
|
+
/** *********
|
|
74
|
+
* Browse results returned from server
|
|
75
|
+
********** */
|
|
76
|
+
export interface BrowseResponse<ResponseType> extends Record<string, any> {
|
|
77
|
+
request?: Partial<BrowseRequestType>;
|
|
78
|
+
response?: Partial<ResponseType>;
|
|
79
|
+
result_id?: string;
|
|
80
|
+
ad_based?: boolean;
|
|
83
81
|
}
|
|
84
82
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
export type GetBrowseResultsResponse =
|
|
84
|
+
BrowseResponse<GetBrowseResultsResponseData>;
|
|
85
|
+
export type GetBrowseResultsForItemIdsResponse =
|
|
86
|
+
BrowseResponse<GetBrowseResultsResponseData>;
|
|
87
|
+
export type GetBrowseGroupsResponse = BrowseResponse<
|
|
88
|
+
Pick<
|
|
89
|
+
GetBrowseResultsResponseData,
|
|
90
|
+
'result_sources' | 'groups' | 'refined_content'
|
|
91
|
+
>
|
|
92
|
+
>;
|
|
93
|
+
export type GetBrowseFacetsResponse = BrowseResponse<
|
|
94
|
+
Pick<GetBrowseResultsResponseData, 'facets' | 'total_num_results'>
|
|
95
|
+
>;
|
|
96
|
+
export type GetBrowseFacetOptionsResponse = BrowseResponse<
|
|
97
|
+
Pick<GetBrowseResultsResponseData, 'facets'>
|
|
98
|
+
>;
|
|
90
99
|
|
|
100
|
+
export interface GetBrowseResultsResponseData extends Record<string, any> {
|
|
101
|
+
result_sources: Partial<ResultSources>;
|
|
102
|
+
facets: Partial<Facet>[];
|
|
103
|
+
groups: Partial<Group>[];
|
|
104
|
+
results: Partial<BrowseResultData>[];
|
|
105
|
+
sort_options: Partial<SortOption>[];
|
|
106
|
+
refined_content: Record<string, any>[];
|
|
107
|
+
total_num_results: number;
|
|
108
|
+
features: Partial<Feature>[];
|
|
109
|
+
collection: Partial<Collection>;
|
|
91
110
|
}
|
|
92
111
|
|
|
93
|
-
interface
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
export interface BrowseResultData extends Record<string, any> {
|
|
113
|
+
matched_terms: string[];
|
|
114
|
+
data: {
|
|
115
|
+
id: string;
|
|
116
|
+
[key: string]: any;
|
|
117
|
+
};
|
|
118
|
+
value: string;
|
|
119
|
+
is_slotted: false;
|
|
120
|
+
labels: Record<string, any>;
|
|
121
|
+
variations: Record<string, any>[];
|
|
103
122
|
}
|
|
104
123
|
|
|
105
|
-
interface
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
export interface BrowseRequestType extends Record<string, any> {
|
|
125
|
+
browse_filter_name: string;
|
|
126
|
+
browse_filter_value: string;
|
|
127
|
+
filter_match_types: Record<string, any>;
|
|
128
|
+
filters: Record<string, any>;
|
|
129
|
+
fmt_options: Record<string, any>;
|
|
130
|
+
num_results_per_page: number;
|
|
131
|
+
page: number;
|
|
132
|
+
section: string;
|
|
133
|
+
sort_by: string;
|
|
134
|
+
sort_order: string;
|
|
135
|
+
term: string;
|
|
136
|
+
query: string;
|
|
137
|
+
features: Partial<RequestFeature>;
|
|
138
|
+
feature_variants: Partial<RequestFeatureVariant>;
|
|
139
|
+
searchandized_items: Record<string, any>;
|
|
115
140
|
}
|
|
116
|
-
|
|
117
|
-
interface Request extends Record<string, any> {
|
|
118
|
-
browse_filter_name: string;
|
|
119
|
-
browse_filter_value: string;
|
|
120
|
-
filter_match_types: Record<string, any>,
|
|
121
|
-
filters: Record<string, any>,
|
|
122
|
-
fmt_options: Record<string, any>,
|
|
123
|
-
num_results_per_page: number;
|
|
124
|
-
page: number,
|
|
125
|
-
section: string,
|
|
126
|
-
sort_by: string,
|
|
127
|
-
sort_order: string,
|
|
128
|
-
term: string;
|
|
129
|
-
query: string;
|
|
130
|
-
features: Partial<RequestFeature>;
|
|
131
|
-
feature_variants: Partial<RequestFeatureVariant>;
|
|
132
|
-
searchandized_items: Record<string, any>;
|
|
133
|
-
}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import Search from
|
|
2
|
-
import Browse from
|
|
3
|
-
import Autocomplete from
|
|
4
|
-
import Recommendations from
|
|
5
|
-
import Tracker from
|
|
6
|
-
import { ConstructorClientOptions } from
|
|
1
|
+
import Search from './search';
|
|
2
|
+
import Browse from './browse';
|
|
3
|
+
import Autocomplete from './autocomplete';
|
|
4
|
+
import Recommendations from './recommendations';
|
|
5
|
+
import Tracker from './tracker';
|
|
6
|
+
import { ConstructorClientOptions } from '.';
|
|
7
7
|
|
|
8
8
|
export = ConstructorIO;
|
|
9
9
|
|
|
10
|
-
/*********************
|
|
11
|
-
*
|
|
12
|
-
* Constructor client
|
|
13
|
-
*
|
|
14
|
-
*********************/
|
|
15
10
|
declare class ConstructorIO {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
constructor(options: ConstructorClientOptions);
|
|
12
|
+
|
|
13
|
+
private options: ConstructorClientOptions;
|
|
14
|
+
|
|
15
|
+
search: Search;
|
|
16
|
+
|
|
17
|
+
browse: Browse;
|
|
18
|
+
|
|
19
|
+
autocomplete: Autocomplete;
|
|
20
|
+
|
|
21
|
+
recommendations: Recommendations;
|
|
22
|
+
|
|
23
|
+
tracker: Tracker;
|
|
24
|
+
|
|
25
|
+
setClientOptions(options: ConstructorClientOptions): void;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
declare namespace ConstructorIO {
|
|
28
|
-
|
|
29
|
-
}
|
|
29
|
+
export { Search, Browse, Autocomplete, Recommendations, Tracker };
|
|
30
|
+
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { ConstructorClientOptions } from
|
|
1
|
+
import { ConstructorClientOptions } from '.';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export default EventDispatcher;
|
|
4
4
|
|
|
5
5
|
declare class EventDispatcher {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
constructor(options: ConstructorClientOptions);
|
|
7
|
+
|
|
8
|
+
events: { name: string; data: Record<string, any> }[];
|
|
9
|
+
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
|
|
12
|
+
waitForBeacon: boolean;
|
|
13
|
+
|
|
14
|
+
active: boolean;
|
|
15
|
+
|
|
16
|
+
queue(name: string, data: Record<string, any>): void;
|
|
17
|
+
|
|
18
|
+
dispatchEvents(): void;
|
|
13
19
|
}
|