@constructor-io/constructorio-node 4.14.4 → 4.15.0
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 +1 -1
- package/src/modules/catalog.js +9 -7
package/package.json
CHANGED
package/src/modules/catalog.js
CHANGED
|
@@ -9,13 +9,15 @@ const helpers = require('../utils/helpers');
|
|
|
9
9
|
const { toSnakeCaseKeys } = require('../utils/helpers');
|
|
10
10
|
|
|
11
11
|
// Create URL from supplied path and options
|
|
12
|
-
function createCatalogUrl(path, options, additionalQueryParams = {}, apiVersion = 'v1') {
|
|
12
|
+
function createCatalogUrl(path, options, additionalQueryParams = {}, apiVersion = 'v1', includeCParam = true) {
|
|
13
13
|
const {
|
|
14
14
|
apiKey,
|
|
15
15
|
serviceUrl,
|
|
16
|
+
version,
|
|
16
17
|
} = options;
|
|
17
18
|
let queryParams = {
|
|
18
19
|
...additionalQueryParams,
|
|
20
|
+
c: includeCParam ? version : undefined,
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
// Validate path is provided
|
|
@@ -2169,7 +2171,7 @@ class Catalog {
|
|
|
2169
2171
|
const controller = new AbortController();
|
|
2170
2172
|
const { signal } = controller;
|
|
2171
2173
|
const { queryParams, formData } = await createQueryParamsAndFormData(parameters);
|
|
2172
|
-
const requestUrl = createCatalogUrl('catalog', this.options, queryParams);
|
|
2174
|
+
const requestUrl = createCatalogUrl('catalog', this.options, queryParams, undefined, false);
|
|
2173
2175
|
|
|
2174
2176
|
// Handle network timeout if specified
|
|
2175
2177
|
helpers.applyNetworkTimeout(this.options, networkParameters, controller);
|
|
@@ -2221,7 +2223,7 @@ class Catalog {
|
|
|
2221
2223
|
const controller = new AbortController();
|
|
2222
2224
|
const { signal } = controller;
|
|
2223
2225
|
const { queryParams, formData } = await createQueryParamsAndFormData(parameters);
|
|
2224
|
-
const requestUrl = createCatalogUrl('catalog', this.options, queryParams);
|
|
2226
|
+
const requestUrl = createCatalogUrl('catalog', this.options, queryParams, undefined, false);
|
|
2225
2227
|
|
|
2226
2228
|
// Handle network timeout if specified
|
|
2227
2229
|
helpers.applyNetworkTimeout(this.options, networkParameters, controller);
|
|
@@ -2274,7 +2276,7 @@ class Catalog {
|
|
|
2274
2276
|
const controller = new AbortController();
|
|
2275
2277
|
const { signal } = controller;
|
|
2276
2278
|
const { queryParams, formData } = await createQueryParamsAndFormData(parameters);
|
|
2277
|
-
const requestUrl = createCatalogUrl('catalog', this.options, { ...queryParams, patch_delta: true });
|
|
2279
|
+
const requestUrl = createCatalogUrl('catalog', this.options, { ...queryParams, patch_delta: true }, undefined, false);
|
|
2278
2280
|
|
|
2279
2281
|
// Handle network timeout if specified
|
|
2280
2282
|
helpers.applyNetworkTimeout(this.options, networkParameters, controller);
|
|
@@ -2331,7 +2333,7 @@ class Catalog {
|
|
|
2331
2333
|
queryParams.notification_email = notificationEmail;
|
|
2332
2334
|
}
|
|
2333
2335
|
|
|
2334
|
-
const requestUrl = createCatalogUrl('catalog', this.options, queryParams);
|
|
2336
|
+
const requestUrl = createCatalogUrl('catalog', this.options, queryParams, undefined, false);
|
|
2335
2337
|
// Handle network timeout if specified
|
|
2336
2338
|
helpers.applyNetworkTimeout(this.options, networkParameters, controller);
|
|
2337
2339
|
|
|
@@ -2388,7 +2390,7 @@ class Catalog {
|
|
|
2388
2390
|
queryParams.notification_email = notificationEmail;
|
|
2389
2391
|
}
|
|
2390
2392
|
|
|
2391
|
-
const requestUrl = createCatalogUrl('catalog', this.options, queryParams);
|
|
2393
|
+
const requestUrl = createCatalogUrl('catalog', this.options, queryParams, undefined, false);
|
|
2392
2394
|
|
|
2393
2395
|
// Handle network timeout if specified
|
|
2394
2396
|
helpers.applyNetworkTimeout(this.options, networkParameters, controller);
|
|
@@ -2445,7 +2447,7 @@ class Catalog {
|
|
|
2445
2447
|
queryParams.notification_email = notificationEmail;
|
|
2446
2448
|
}
|
|
2447
2449
|
|
|
2448
|
-
const requestUrl = createCatalogUrl('catalog', this.options, { ...queryParams, patch_delta: true });
|
|
2450
|
+
const requestUrl = createCatalogUrl('catalog', this.options, { ...queryParams, patch_delta: true }, undefined, false);
|
|
2449
2451
|
|
|
2450
2452
|
// Handle network timeout if specified
|
|
2451
2453
|
helpers.applyNetworkTimeout(this.options, networkParameters, controller);
|