@constructor-io/constructorio-node 4.16.1 → 4.16.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-node",
3
- "version": "4.16.1",
3
+ "version": "4.16.2",
4
4
  "description": "Constructor.io Node.js client",
5
5
  "main": "src/constructorio.js",
6
6
  "types": "src/types/constructorio.d.ts",
@@ -43,7 +43,7 @@ function createQuizUrl(quizId, parameters, userParameters, options, path) {
43
43
  }
44
44
 
45
45
  if (parameters) {
46
- const { section, answers, quizVersionId, quizSessionId } = parameters;
46
+ const { section, answers, quizVersionId, quizSessionId, filters, resultsPerPage, page } = parameters;
47
47
 
48
48
  // Pull section from parameters
49
49
  if (section) {
@@ -60,6 +60,18 @@ function createQuizUrl(quizId, parameters, userParameters, options, path) {
60
60
  queryParams.quiz_session_id = quizSessionId;
61
61
  }
62
62
 
63
+ if (!helpers.isNil(page)) {
64
+ queryParams.page = page;
65
+ }
66
+
67
+ if (!helpers.isNil(resultsPerPage)) {
68
+ queryParams.num_results_per_page = resultsPerPage;
69
+ }
70
+
71
+ if (filters) {
72
+ queryParams.filters = filters;
73
+ }
74
+
63
75
  // Pull answers from parameters and transform
64
76
  if (answers) {
65
77
  answers.forEach((ans) => {
@@ -177,6 +189,9 @@ class Quizzes {
177
189
  * @param {string} [parameters.section] - Product catalog section
178
190
  * @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 [here]{@link https://docs.constructor.io/rest_api/quiz/using_quizzes/#quiz-versioning}
179
191
  * @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 [here]{@link https://docs.constructor.io/rest_api/quiz/using_quizzes/#quiz-sessions}
192
+ * @param {number} [parameters.page] - The page number of the results
193
+ * @param {number} [parameters.resultsPerPage] - The number of results per page to return
194
+ * @param {object} [parameters.filters] - Key / value mapping (dictionary) of filters used to refine results
180
195
  * @param {object} [userParameters] - Parameters relevant to the user request
181
196
  * @param {number} [userParameters.sessionId] - Session ID, utilized to personalize results
182
197
  * @param {string} [userParameters.clientId] - Client ID, utilized to personalize results