@gofynd/fdk-client-javascript 3.0.0-beta.1 → 3.1.0-beta.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/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +14 -14
- package/sdk/application/Cart/CartApplicationClient.js +14 -14
- package/sdk/application/Content/ContentApplicationClient.d.ts +10 -0
- package/sdk/application/Content/ContentApplicationClient.js +53 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -6
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +34 -0
- package/sdk/application/Logistic/LogisticApplicationClient.js +136 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +12 -12
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +12 -12
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +46 -33
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +41 -25
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +4 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +6 -397
- package/sdk/platform/Billing/BillingPlatformClient.js +77 -3215
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +417 -3811
- package/sdk/platform/Billing/BillingPlatformModel.js +292 -2544
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +12 -451
- package/sdk/platform/Billing/BillingPlatformValidator.js +8 -483
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -34
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +34 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +363 -29
- package/sdk/platform/Cart/CartPlatformModel.js +203 -31
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +57 -57
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +220 -200
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +121 -91
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +58 -46
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +10 -51
- package/sdk/platform/Catalog/CatalogPlatformClient.js +79 -400
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +22 -228
- package/sdk/platform/Catalog/CatalogPlatformModel.js +12 -163
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +15 -61
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -65
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +4 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +10 -14
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +94 -30
- package/sdk/platform/Communication/CommunicationPlatformModel.js +110 -32
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +33 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +62 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +11 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +5 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +12 -2
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -1
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +6 -4
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +12 -10
- package/sdk/platform/Content/ContentPlatformModel.d.ts +42 -12
- package/sdk/platform/Content/ContentPlatformModel.js +43 -13
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +28 -28
- package/sdk/platform/Finance/FinancePlatformClient.js +28 -28
- package/sdk/platform/Order/OrderPlatformClient.d.ts +21 -21
- package/sdk/platform/Order/OrderPlatformClient.js +21 -21
- package/sdk/platform/Order/OrderPlatformModel.d.ts +1010 -80
- package/sdk/platform/Order/OrderPlatformModel.js +665 -70
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +31 -4
- package/sdk/platform/Payment/PaymentPlatformModel.js +11 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +8 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +14 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +6 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +24 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +119 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +194 -23
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +116 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +23 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +16 -0
- package/sdk/platform/Share/SharePlatformModel.d.ts +5 -0
- package/sdk/platform/Share/SharePlatformModel.js +2 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +10 -12
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +45 -49
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +10 -10
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +12 -12
- package/sdk/public/PublicClient.d.ts +0 -2
- package/sdk/public/PublicClient.js +0 -4
- package/sdk/public/index.d.ts +0 -1
- package/sdk/public/index.js +0 -2
- package/sdk/public/Billing/BillingPublicClient.d.ts +0 -56
- package/sdk/public/Billing/BillingPublicClient.js +0 -397
- package/sdk/public/Billing/BillingPublicModel.d.ts +0 -919
- package/sdk/public/Billing/BillingPublicModel.js +0 -560
- package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -43
- package/sdk/public/Billing/BillingPublicValidator.js +0 -50
|
@@ -334,165 +334,6 @@ class Catalog {
|
|
|
334
334
|
return response;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
/**
|
|
338
|
-
* @param {CatalogPlatformValidator.CreateCategoriesParam} arg - Arg object
|
|
339
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
340
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
341
|
-
* @returns {Promise<CatalogPlatformModel.CategoryCreateResponse>} - Success response
|
|
342
|
-
* @name createCategories
|
|
343
|
-
* @summary: Create categories.
|
|
344
|
-
* @description: Lets user create product categories on for the seller on the platform. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/createCategories/).
|
|
345
|
-
*/
|
|
346
|
-
async createCategories(
|
|
347
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
348
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
349
|
-
) {
|
|
350
|
-
const { error } = CatalogPlatformValidator.createCategories().validate(
|
|
351
|
-
{
|
|
352
|
-
body,
|
|
353
|
-
},
|
|
354
|
-
{ abortEarly: false, allowUnknown: true }
|
|
355
|
-
);
|
|
356
|
-
if (error) {
|
|
357
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
// Showing warrnings if extra unknown parameters are found
|
|
361
|
-
const {
|
|
362
|
-
error: warrning,
|
|
363
|
-
} = CatalogPlatformValidator.createCategories().validate(
|
|
364
|
-
{
|
|
365
|
-
body,
|
|
366
|
-
},
|
|
367
|
-
{ abortEarly: false, allowUnknown: false }
|
|
368
|
-
);
|
|
369
|
-
if (warrning) {
|
|
370
|
-
Logger({
|
|
371
|
-
level: "WARN",
|
|
372
|
-
message: `Parameter Validation warrnings for platform > Catalog > createCategories \n ${warrning}`,
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
const query_params = {};
|
|
377
|
-
|
|
378
|
-
const xHeaders = {};
|
|
379
|
-
|
|
380
|
-
const response = await PlatformAPIClient.execute(
|
|
381
|
-
this.config,
|
|
382
|
-
"post",
|
|
383
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/category`,
|
|
384
|
-
query_params,
|
|
385
|
-
body,
|
|
386
|
-
{ ...xHeaders, ...requestHeaders },
|
|
387
|
-
{ responseHeaders }
|
|
388
|
-
);
|
|
389
|
-
|
|
390
|
-
let responseData = response;
|
|
391
|
-
if (responseHeaders) {
|
|
392
|
-
responseData = response[0];
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
const {
|
|
396
|
-
error: res_error,
|
|
397
|
-
} = CatalogPlatformModel.CategoryCreateResponse().validate(responseData, {
|
|
398
|
-
abortEarly: false,
|
|
399
|
-
allowUnknown: true,
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
if (res_error) {
|
|
403
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
404
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
405
|
-
} else {
|
|
406
|
-
Logger({
|
|
407
|
-
level: "WARN",
|
|
408
|
-
message: `Response Validation Warnings for platform > Catalog > createCategories \n ${res_error}`,
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
return response;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* @param {CatalogPlatformValidator.CreateDepartmentsParam} arg - Arg object
|
|
418
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
419
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
420
|
-
* @returns {Promise<CatalogPlatformModel.DepartmentCreateResponse>} -
|
|
421
|
-
* Success response
|
|
422
|
-
* @name createDepartments
|
|
423
|
-
* @summary: Create departments.
|
|
424
|
-
* @description: Create departments with this resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/createDepartments/).
|
|
425
|
-
*/
|
|
426
|
-
async createDepartments(
|
|
427
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
428
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
429
|
-
) {
|
|
430
|
-
const { error } = CatalogPlatformValidator.createDepartments().validate(
|
|
431
|
-
{
|
|
432
|
-
body,
|
|
433
|
-
},
|
|
434
|
-
{ abortEarly: false, allowUnknown: true }
|
|
435
|
-
);
|
|
436
|
-
if (error) {
|
|
437
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
// Showing warrnings if extra unknown parameters are found
|
|
441
|
-
const {
|
|
442
|
-
error: warrning,
|
|
443
|
-
} = CatalogPlatformValidator.createDepartments().validate(
|
|
444
|
-
{
|
|
445
|
-
body,
|
|
446
|
-
},
|
|
447
|
-
{ abortEarly: false, allowUnknown: false }
|
|
448
|
-
);
|
|
449
|
-
if (warrning) {
|
|
450
|
-
Logger({
|
|
451
|
-
level: "WARN",
|
|
452
|
-
message: `Parameter Validation warrnings for platform > Catalog > createDepartments \n ${warrning}`,
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
const query_params = {};
|
|
457
|
-
|
|
458
|
-
const xHeaders = {};
|
|
459
|
-
|
|
460
|
-
const response = await PlatformAPIClient.execute(
|
|
461
|
-
this.config,
|
|
462
|
-
"post",
|
|
463
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/departments`,
|
|
464
|
-
query_params,
|
|
465
|
-
body,
|
|
466
|
-
{ ...xHeaders, ...requestHeaders },
|
|
467
|
-
{ responseHeaders }
|
|
468
|
-
);
|
|
469
|
-
|
|
470
|
-
let responseData = response;
|
|
471
|
-
if (responseHeaders) {
|
|
472
|
-
responseData = response[0];
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
const {
|
|
476
|
-
error: res_error,
|
|
477
|
-
} = CatalogPlatformModel.DepartmentCreateResponse().validate(responseData, {
|
|
478
|
-
abortEarly: false,
|
|
479
|
-
allowUnknown: true,
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
if (res_error) {
|
|
483
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
484
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
485
|
-
} else {
|
|
486
|
-
Logger({
|
|
487
|
-
level: "WARN",
|
|
488
|
-
message: `Response Validation Warnings for platform > Catalog > createDepartments \n ${res_error}`,
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
return response;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
337
|
/**
|
|
497
338
|
* @param {CatalogPlatformValidator.CreateInventoryExportParam} arg - Arg object
|
|
498
339
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -2043,6 +1884,85 @@ class Catalog {
|
|
|
2043
1884
|
return response;
|
|
2044
1885
|
}
|
|
2045
1886
|
|
|
1887
|
+
/**
|
|
1888
|
+
* @param {CatalogPlatformValidator.GetAttributeParam} arg - Arg object
|
|
1889
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1890
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1891
|
+
* @returns {Promise<CatalogPlatformModel.AttributeDetail>} - Success response
|
|
1892
|
+
* @name getAttribute
|
|
1893
|
+
* @summary: Get attribute detail by slug
|
|
1894
|
+
* @description: Retrieve the attribute detail for catalog listings by attribute slug passed for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/getAttribute/).
|
|
1895
|
+
*/
|
|
1896
|
+
async getAttribute(
|
|
1897
|
+
{ attributeSlug, requestHeaders } = { requestHeaders: {} },
|
|
1898
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1899
|
+
) {
|
|
1900
|
+
const { error } = CatalogPlatformValidator.getAttribute().validate(
|
|
1901
|
+
{
|
|
1902
|
+
attributeSlug,
|
|
1903
|
+
},
|
|
1904
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1905
|
+
);
|
|
1906
|
+
if (error) {
|
|
1907
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1911
|
+
const {
|
|
1912
|
+
error: warrning,
|
|
1913
|
+
} = CatalogPlatformValidator.getAttribute().validate(
|
|
1914
|
+
{
|
|
1915
|
+
attributeSlug,
|
|
1916
|
+
},
|
|
1917
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1918
|
+
);
|
|
1919
|
+
if (warrning) {
|
|
1920
|
+
Logger({
|
|
1921
|
+
level: "WARN",
|
|
1922
|
+
message: `Parameter Validation warrnings for platform > Catalog > getAttribute \n ${warrning}`,
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
const query_params = {};
|
|
1927
|
+
|
|
1928
|
+
const xHeaders = {};
|
|
1929
|
+
|
|
1930
|
+
const response = await PlatformAPIClient.execute(
|
|
1931
|
+
this.config,
|
|
1932
|
+
"get",
|
|
1933
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/product-attributes/${attributeSlug}`,
|
|
1934
|
+
query_params,
|
|
1935
|
+
undefined,
|
|
1936
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1937
|
+
{ responseHeaders }
|
|
1938
|
+
);
|
|
1939
|
+
|
|
1940
|
+
let responseData = response;
|
|
1941
|
+
if (responseHeaders) {
|
|
1942
|
+
responseData = response[0];
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
const {
|
|
1946
|
+
error: res_error,
|
|
1947
|
+
} = CatalogPlatformModel.AttributeDetail().validate(responseData, {
|
|
1948
|
+
abortEarly: false,
|
|
1949
|
+
allowUnknown: true,
|
|
1950
|
+
});
|
|
1951
|
+
|
|
1952
|
+
if (res_error) {
|
|
1953
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1954
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1955
|
+
} else {
|
|
1956
|
+
Logger({
|
|
1957
|
+
level: "WARN",
|
|
1958
|
+
message: `Response Validation Warnings for platform > Catalog > getAttribute \n ${res_error}`,
|
|
1959
|
+
});
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
return response;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
2046
1966
|
/**
|
|
2047
1967
|
* @param {CatalogPlatformValidator.GetCategoryDataParam} arg - Arg object
|
|
2048
1968
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -2619,85 +2539,6 @@ class Catalog {
|
|
|
2619
2539
|
return response;
|
|
2620
2540
|
}
|
|
2621
2541
|
|
|
2622
|
-
/**
|
|
2623
|
-
* @param {CatalogPlatformValidator.GetGenderAttributeParam} arg - Arg object
|
|
2624
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2625
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2626
|
-
* @returns {Promise<CatalogPlatformModel.GenderDetail>} - Success response
|
|
2627
|
-
* @name getGenderAttribute
|
|
2628
|
-
* @summary: Get gender attribute.
|
|
2629
|
-
* @description: Retrieve the gender attribute for catalog listings. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/getGenderAttribute/).
|
|
2630
|
-
*/
|
|
2631
|
-
async getGenderAttribute(
|
|
2632
|
-
{ attributeSlug, requestHeaders } = { requestHeaders: {} },
|
|
2633
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
2634
|
-
) {
|
|
2635
|
-
const { error } = CatalogPlatformValidator.getGenderAttribute().validate(
|
|
2636
|
-
{
|
|
2637
|
-
attributeSlug,
|
|
2638
|
-
},
|
|
2639
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2640
|
-
);
|
|
2641
|
-
if (error) {
|
|
2642
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2643
|
-
}
|
|
2644
|
-
|
|
2645
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2646
|
-
const {
|
|
2647
|
-
error: warrning,
|
|
2648
|
-
} = CatalogPlatformValidator.getGenderAttribute().validate(
|
|
2649
|
-
{
|
|
2650
|
-
attributeSlug,
|
|
2651
|
-
},
|
|
2652
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2653
|
-
);
|
|
2654
|
-
if (warrning) {
|
|
2655
|
-
Logger({
|
|
2656
|
-
level: "WARN",
|
|
2657
|
-
message: `Parameter Validation warrnings for platform > Catalog > getGenderAttribute \n ${warrning}`,
|
|
2658
|
-
});
|
|
2659
|
-
}
|
|
2660
|
-
|
|
2661
|
-
const query_params = {};
|
|
2662
|
-
|
|
2663
|
-
const xHeaders = {};
|
|
2664
|
-
|
|
2665
|
-
const response = await PlatformAPIClient.execute(
|
|
2666
|
-
this.config,
|
|
2667
|
-
"get",
|
|
2668
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/product-attributes/${attributeSlug}`,
|
|
2669
|
-
query_params,
|
|
2670
|
-
undefined,
|
|
2671
|
-
{ ...xHeaders, ...requestHeaders },
|
|
2672
|
-
{ responseHeaders }
|
|
2673
|
-
);
|
|
2674
|
-
|
|
2675
|
-
let responseData = response;
|
|
2676
|
-
if (responseHeaders) {
|
|
2677
|
-
responseData = response[0];
|
|
2678
|
-
}
|
|
2679
|
-
|
|
2680
|
-
const {
|
|
2681
|
-
error: res_error,
|
|
2682
|
-
} = CatalogPlatformModel.GenderDetail().validate(responseData, {
|
|
2683
|
-
abortEarly: false,
|
|
2684
|
-
allowUnknown: true,
|
|
2685
|
-
});
|
|
2686
|
-
|
|
2687
|
-
if (res_error) {
|
|
2688
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
2689
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2690
|
-
} else {
|
|
2691
|
-
Logger({
|
|
2692
|
-
level: "WARN",
|
|
2693
|
-
message: `Response Validation Warnings for platform > Catalog > getGenderAttribute \n ${res_error}`,
|
|
2694
|
-
});
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
|
|
2698
|
-
return response;
|
|
2699
|
-
}
|
|
2700
|
-
|
|
2701
2542
|
/**
|
|
2702
2543
|
* @param {CatalogPlatformValidator.GetHsnCodeParam} arg - Arg object
|
|
2703
2544
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -6155,168 +5996,6 @@ class Catalog {
|
|
|
6155
5996
|
return response;
|
|
6156
5997
|
}
|
|
6157
5998
|
|
|
6158
|
-
/**
|
|
6159
|
-
* @param {CatalogPlatformValidator.UpdateCategoryParam} arg - Arg object
|
|
6160
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
6161
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
6162
|
-
* @returns {Promise<CatalogPlatformModel.CategoryUpdateResponse>} - Success response
|
|
6163
|
-
* @name updateCategory
|
|
6164
|
-
* @summary: Update category data.
|
|
6165
|
-
* @description: Modify data for an existing category in the catalog. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/updateCategory/).
|
|
6166
|
-
*/
|
|
6167
|
-
async updateCategory(
|
|
6168
|
-
{ uid, body, requestHeaders } = { requestHeaders: {} },
|
|
6169
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
6170
|
-
) {
|
|
6171
|
-
const { error } = CatalogPlatformValidator.updateCategory().validate(
|
|
6172
|
-
{
|
|
6173
|
-
uid,
|
|
6174
|
-
body,
|
|
6175
|
-
},
|
|
6176
|
-
{ abortEarly: false, allowUnknown: true }
|
|
6177
|
-
);
|
|
6178
|
-
if (error) {
|
|
6179
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
6180
|
-
}
|
|
6181
|
-
|
|
6182
|
-
// Showing warrnings if extra unknown parameters are found
|
|
6183
|
-
const {
|
|
6184
|
-
error: warrning,
|
|
6185
|
-
} = CatalogPlatformValidator.updateCategory().validate(
|
|
6186
|
-
{
|
|
6187
|
-
uid,
|
|
6188
|
-
body,
|
|
6189
|
-
},
|
|
6190
|
-
{ abortEarly: false, allowUnknown: false }
|
|
6191
|
-
);
|
|
6192
|
-
if (warrning) {
|
|
6193
|
-
Logger({
|
|
6194
|
-
level: "WARN",
|
|
6195
|
-
message: `Parameter Validation warrnings for platform > Catalog > updateCategory \n ${warrning}`,
|
|
6196
|
-
});
|
|
6197
|
-
}
|
|
6198
|
-
|
|
6199
|
-
const query_params = {};
|
|
6200
|
-
|
|
6201
|
-
const xHeaders = {};
|
|
6202
|
-
|
|
6203
|
-
const response = await PlatformAPIClient.execute(
|
|
6204
|
-
this.config,
|
|
6205
|
-
"put",
|
|
6206
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/category/${uid}`,
|
|
6207
|
-
query_params,
|
|
6208
|
-
body,
|
|
6209
|
-
{ ...xHeaders, ...requestHeaders },
|
|
6210
|
-
{ responseHeaders }
|
|
6211
|
-
);
|
|
6212
|
-
|
|
6213
|
-
let responseData = response;
|
|
6214
|
-
if (responseHeaders) {
|
|
6215
|
-
responseData = response[0];
|
|
6216
|
-
}
|
|
6217
|
-
|
|
6218
|
-
const {
|
|
6219
|
-
error: res_error,
|
|
6220
|
-
} = CatalogPlatformModel.CategoryUpdateResponse().validate(responseData, {
|
|
6221
|
-
abortEarly: false,
|
|
6222
|
-
allowUnknown: true,
|
|
6223
|
-
});
|
|
6224
|
-
|
|
6225
|
-
if (res_error) {
|
|
6226
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
6227
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
6228
|
-
} else {
|
|
6229
|
-
Logger({
|
|
6230
|
-
level: "WARN",
|
|
6231
|
-
message: `Response Validation Warnings for platform > Catalog > updateCategory \n ${res_error}`,
|
|
6232
|
-
});
|
|
6233
|
-
}
|
|
6234
|
-
}
|
|
6235
|
-
|
|
6236
|
-
return response;
|
|
6237
|
-
}
|
|
6238
|
-
|
|
6239
|
-
/**
|
|
6240
|
-
* @param {CatalogPlatformValidator.UpdateDepartmentParam} arg - Arg object
|
|
6241
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
6242
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
6243
|
-
* @returns {Promise<CatalogPlatformModel.DepartmentModel>} - Success response
|
|
6244
|
-
* @name updateDepartment
|
|
6245
|
-
* @summary: Update department data.
|
|
6246
|
-
* @description: Modify the department by their uid using this API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/updateDepartment/).
|
|
6247
|
-
*/
|
|
6248
|
-
async updateDepartment(
|
|
6249
|
-
{ uid, body, requestHeaders } = { requestHeaders: {} },
|
|
6250
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
6251
|
-
) {
|
|
6252
|
-
const { error } = CatalogPlatformValidator.updateDepartment().validate(
|
|
6253
|
-
{
|
|
6254
|
-
uid,
|
|
6255
|
-
body,
|
|
6256
|
-
},
|
|
6257
|
-
{ abortEarly: false, allowUnknown: true }
|
|
6258
|
-
);
|
|
6259
|
-
if (error) {
|
|
6260
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
6261
|
-
}
|
|
6262
|
-
|
|
6263
|
-
// Showing warrnings if extra unknown parameters are found
|
|
6264
|
-
const {
|
|
6265
|
-
error: warrning,
|
|
6266
|
-
} = CatalogPlatformValidator.updateDepartment().validate(
|
|
6267
|
-
{
|
|
6268
|
-
uid,
|
|
6269
|
-
body,
|
|
6270
|
-
},
|
|
6271
|
-
{ abortEarly: false, allowUnknown: false }
|
|
6272
|
-
);
|
|
6273
|
-
if (warrning) {
|
|
6274
|
-
Logger({
|
|
6275
|
-
level: "WARN",
|
|
6276
|
-
message: `Parameter Validation warrnings for platform > Catalog > updateDepartment \n ${warrning}`,
|
|
6277
|
-
});
|
|
6278
|
-
}
|
|
6279
|
-
|
|
6280
|
-
const query_params = {};
|
|
6281
|
-
|
|
6282
|
-
const xHeaders = {};
|
|
6283
|
-
|
|
6284
|
-
const response = await PlatformAPIClient.execute(
|
|
6285
|
-
this.config,
|
|
6286
|
-
"put",
|
|
6287
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/${uid}`,
|
|
6288
|
-
query_params,
|
|
6289
|
-
body,
|
|
6290
|
-
{ ...xHeaders, ...requestHeaders },
|
|
6291
|
-
{ responseHeaders }
|
|
6292
|
-
);
|
|
6293
|
-
|
|
6294
|
-
let responseData = response;
|
|
6295
|
-
if (responseHeaders) {
|
|
6296
|
-
responseData = response[0];
|
|
6297
|
-
}
|
|
6298
|
-
|
|
6299
|
-
const {
|
|
6300
|
-
error: res_error,
|
|
6301
|
-
} = CatalogPlatformModel.DepartmentModel().validate(responseData, {
|
|
6302
|
-
abortEarly: false,
|
|
6303
|
-
allowUnknown: true,
|
|
6304
|
-
});
|
|
6305
|
-
|
|
6306
|
-
if (res_error) {
|
|
6307
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
6308
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
6309
|
-
} else {
|
|
6310
|
-
Logger({
|
|
6311
|
-
level: "WARN",
|
|
6312
|
-
message: `Response Validation Warnings for platform > Catalog > updateDepartment \n ${res_error}`,
|
|
6313
|
-
});
|
|
6314
|
-
}
|
|
6315
|
-
}
|
|
6316
|
-
|
|
6317
|
-
return response;
|
|
6318
|
-
}
|
|
6319
|
-
|
|
6320
5999
|
/**
|
|
6321
6000
|
* @param {CatalogPlatformValidator.UpdateInventoriesParam} arg - Arg object
|
|
6322
6001
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|