@constructor-io/constructorio-client-javascript 2.70.0 → 2.71.1
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 +6 -1
- package/lib/modules/search.js +5 -5
- package/lib/types/index.d.ts +7 -2
- package/lib/types/quizzes.d.ts +5 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/lib/modules/quizzes.js
CHANGED
|
@@ -54,7 +54,8 @@ function createQuizUrl(quizId, parameters, options, path) {
|
|
|
54
54
|
resultsPerPage = parameters.resultsPerPage,
|
|
55
55
|
filters = parameters.filters,
|
|
56
56
|
fmtOptions = parameters.fmtOptions,
|
|
57
|
-
hiddenFields = parameters.hiddenFields
|
|
57
|
+
hiddenFields = parameters.hiddenFields,
|
|
58
|
+
skipTracking = parameters.skipTracking;
|
|
58
59
|
|
|
59
60
|
// Pull section from parameters
|
|
60
61
|
if (section) {
|
|
@@ -104,6 +105,9 @@ function createQuizUrl(quizId, parameters, options, path) {
|
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
107
|
}
|
|
108
|
+
if (skipTracking) {
|
|
109
|
+
queryParams.skip_tracking = skipTracking;
|
|
110
|
+
}
|
|
107
111
|
}
|
|
108
112
|
queryParams._dt = Date.now();
|
|
109
113
|
queryParams = helpers.cleanParams(queryParams);
|
|
@@ -136,6 +140,7 @@ var Quizzes = /*#__PURE__*/function () {
|
|
|
136
140
|
* @param {array} [parameters.answers] - An array of answers in the format [[1,2], [1], ["true"], ["seen"], [""]]. Based on the question type, answers should either be an integer, "true"/"false", "seen" or an empty string ("") if skipped
|
|
137
141
|
* @param {string} [parameters.quizVersionId] - Version identifier for the quiz. Version ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.com/reference/configuration-quizzes
|
|
138
142
|
* @param {string} [parameters.quizSessionId] - Session identifier for the quiz. Session ID will be returned with the first request and it should be passed with subsequent requests. More information can be found: https://docs.constructor.com/reference/configuration-quizzes
|
|
143
|
+
* @param {boolean} [parameters.skipTracking] - If true, tracking for this question will be skipped. This is useful for preloading the first question of a quiz
|
|
139
144
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
140
145
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
141
146
|
* @returns {Promise}
|
package/lib/modules/search.js
CHANGED
|
@@ -179,13 +179,13 @@ var Search = /*#__PURE__*/function () {
|
|
|
179
179
|
* @param {string} [parameters.sortBy='relevance'] - The sort method for results
|
|
180
180
|
* @param {string} [parameters.sortOrder='descending'] - The sort order for results
|
|
181
181
|
* @param {string} [parameters.section='Products'] - The section name for results
|
|
182
|
-
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/search-search-
|
|
182
|
+
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results#query-params for details
|
|
183
183
|
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.com/reference/configuration-collections
|
|
184
184
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
185
185
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facets to return
|
|
186
186
|
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.com/reference/shared-variations-mapping for details
|
|
187
|
-
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results
|
|
188
|
-
* @param {object} [parameters.filterMatchTypes] - An object specifying whether results must match `all`, `any` or `none` of a given filter. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results
|
|
187
|
+
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results#query-params
|
|
188
|
+
* @param {object} [parameters.filterMatchTypes] - An object specifying whether results must match `all`, `any` or `none` of a given filter. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results#query-params
|
|
189
189
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
190
190
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
191
191
|
* @returns {Promise}
|
|
@@ -257,12 +257,12 @@ var Search = /*#__PURE__*/function () {
|
|
|
257
257
|
* @param {number} [parameters.offset] - The number of results to skip from the beginning (Can't be used together with page)
|
|
258
258
|
* @param {number} [parameters.resultsPerPage] - The number of results per page to return
|
|
259
259
|
* @param {string} [parameters.section='Products'] - The section name for results
|
|
260
|
-
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/search-search-
|
|
260
|
+
* @param {object} [parameters.fmtOptions] - The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/v1-search-get-natural-language-search-results#query-params for details
|
|
261
261
|
* @param {object} [parameters.preFilterExpression] - Faceting expression to scope search results. Please refer to https://docs.constructor.com/reference/configuration-collections
|
|
262
262
|
* @param {object} [parameters.variationsMap] - The variations map object to aggregate variations. Please refer to https://docs.constructor.com/reference/shared-variations-mapping for details
|
|
263
263
|
* @param {string[]} [parameters.hiddenFields] - Hidden metadata fields to return
|
|
264
264
|
* @param {string[]} [parameters.hiddenFacets] - Hidden facets to return
|
|
265
|
-
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results
|
|
265
|
+
* @param {object} [parameters.qsParam] - Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.com/reference/v1-search-get-natural-language-search-results#query-params
|
|
266
266
|
* @param {object} [networkParameters] - Parameters relevant to the network request
|
|
267
267
|
* @param {number} [networkParameters.timeout] - Request timeout (in milliseconds)
|
|
268
268
|
* @returns {Promise}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -32,8 +32,10 @@ export interface IdOptions extends Record<string, any> {
|
|
|
32
32
|
cookie_days_to_live?: number;
|
|
33
33
|
on_node?: boolean;
|
|
34
34
|
session_is_new?: boolean;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
// defaults to 'cookie'
|
|
36
|
+
client_id_storage_location?: 'cookie' | 'local';
|
|
37
|
+
// defaults to 'local'
|
|
38
|
+
session_id_storage_location?: 'cookie' | 'local';
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export interface EventDispatcherOptions {
|
|
@@ -160,6 +162,9 @@ export interface FmtOptions extends Record<string, any> {
|
|
|
160
162
|
groups_max_depth?: number;
|
|
161
163
|
groups_start?: 'current' | 'top' | `group_id:${string}`;
|
|
162
164
|
fields?: string[]; // Array of metadata field to be returned in the data response
|
|
165
|
+
hidden_fields?: string[];
|
|
166
|
+
show_hidden_fields?: boolean;
|
|
167
|
+
variations_return_type?: 'default' | 'all' | 'matched';
|
|
163
168
|
}
|
|
164
169
|
|
|
165
170
|
export type Nullable<T> = T | null;
|
package/lib/types/quizzes.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ export interface QuizzesParameters {
|
|
|
21
21
|
quizSessionId?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export interface NextQuestionQuizzesParameters extends QuizzesParameters {
|
|
25
|
+
skipTracking?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
24
28
|
export interface QuizResultsFmtOptions {
|
|
25
29
|
hidden_fields?: string[];
|
|
26
30
|
fields?: string[];
|
|
@@ -42,7 +46,7 @@ declare class Quizzes {
|
|
|
42
46
|
|
|
43
47
|
getQuizNextQuestion(
|
|
44
48
|
quizId: string,
|
|
45
|
-
parameters?:
|
|
49
|
+
parameters?: NextQuestionQuizzesParameters,
|
|
46
50
|
networkParameters?: NetworkParameters
|
|
47
51
|
): Promise<NextQuestionResponse>;
|
|
48
52
|
|
package/lib/version.js
CHANGED