@constructor-io/constructorio-node 4.14.1 → 4.14.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/package.json +1 -1
- package/src/modules/catalog.js +23 -2
- package/src/types/index.d.ts +2 -1
package/package.json
CHANGED
package/src/modules/catalog.js
CHANGED
|
@@ -2318,12 +2318,19 @@ class Catalog {
|
|
|
2318
2318
|
*/
|
|
2319
2319
|
async replaceCatalogUsingTarArchive(parameters = {}, networkParameters = {}) {
|
|
2320
2320
|
try {
|
|
2321
|
+
const { force, notification_email, notificationEmail = notification_email } = parameters;
|
|
2321
2322
|
const { fetch } = this.options;
|
|
2322
2323
|
const apiKey = this.options && this.options.apiKey;
|
|
2323
2324
|
const controller = new AbortController();
|
|
2324
2325
|
const { signal } = controller;
|
|
2325
2326
|
const { queryParams, formData } = await createQueryParamsAndFormData(parameters);
|
|
2326
|
-
const
|
|
2327
|
+
const operation = force ? 'forcesync' : 'sync';
|
|
2328
|
+
const formDataWithTarArchive = await addTarArchiveToFormData(parameters, formData, operation, apiKey);
|
|
2329
|
+
|
|
2330
|
+
if (notificationEmail) {
|
|
2331
|
+
queryParams.notification_email = notificationEmail;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2327
2334
|
const requestUrl = createCatalogUrl('catalog', this.options, queryParams);
|
|
2328
2335
|
// Handle network timeout if specified
|
|
2329
2336
|
helpers.applyNetworkTimeout(this.options, networkParameters, controller);
|
|
@@ -2367,12 +2374,20 @@ class Catalog {
|
|
|
2367
2374
|
*/
|
|
2368
2375
|
async updateCatalogUsingTarArchive(parameters = {}, networkParameters = {}) {
|
|
2369
2376
|
try {
|
|
2377
|
+
const { force, notification_email, notificationEmail = notification_email } = parameters;
|
|
2378
|
+
|
|
2370
2379
|
const { fetch } = this.options;
|
|
2371
2380
|
const apiKey = this.options && this.options.apiKey;
|
|
2372
2381
|
const controller = new AbortController();
|
|
2373
2382
|
const { signal } = controller;
|
|
2374
2383
|
const { queryParams, formData } = await createQueryParamsAndFormData(parameters);
|
|
2375
|
-
const
|
|
2384
|
+
const operation = force ? 'forcedelta' : 'delta';
|
|
2385
|
+
const formDataWithTarArchive = await addTarArchiveToFormData(parameters, formData, operation, apiKey);
|
|
2386
|
+
|
|
2387
|
+
if (notificationEmail) {
|
|
2388
|
+
queryParams.notification_email = notificationEmail;
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2376
2391
|
const requestUrl = createCatalogUrl('catalog', this.options, queryParams);
|
|
2377
2392
|
|
|
2378
2393
|
// Handle network timeout if specified
|
|
@@ -2418,12 +2433,18 @@ class Catalog {
|
|
|
2418
2433
|
*/
|
|
2419
2434
|
async patchCatalogUsingTarArchive(parameters = {}, networkParameters = {}) {
|
|
2420
2435
|
try {
|
|
2436
|
+
const { notification_email, notificationEmail = notification_email } = parameters;
|
|
2421
2437
|
const { fetch } = this.options;
|
|
2422
2438
|
const apiKey = this.options && this.options.apiKey;
|
|
2423
2439
|
const controller = new AbortController();
|
|
2424
2440
|
const { signal } = controller;
|
|
2425
2441
|
const { queryParams, formData } = await createQueryParamsAndFormData(parameters);
|
|
2426
2442
|
const formDataWithTarArchive = await addTarArchiveToFormData(parameters, formData, 'patchdelta', apiKey);
|
|
2443
|
+
|
|
2444
|
+
if (notificationEmail) {
|
|
2445
|
+
queryParams.notification_email = notificationEmail;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2427
2448
|
const requestUrl = createCatalogUrl('catalog', this.options, { ...queryParams, patch_delta: true });
|
|
2428
2449
|
|
|
2429
2450
|
// Handle network timeout if specified
|
package/src/types/index.d.ts
CHANGED
|
@@ -33,7 +33,8 @@ export interface UserParameters {
|
|
|
33
33
|
|
|
34
34
|
export interface FmtOptions extends Record<string, any> {
|
|
35
35
|
groups_max_depth?: number;
|
|
36
|
-
groups_start?: 'current' | 'top'
|
|
36
|
+
groups_start?: 'current' | 'top' | `group_id:${string}`;
|
|
37
|
+
fields?: string[]; // Array of metadata field to be returned in the data response
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export interface RequestFeature extends Record<string, any> {
|