@cimplify/sdk 0.9.0 → 0.9.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/dist/advanced.js +1 -21
- package/dist/advanced.mjs +1 -21
- package/dist/index.js +1 -21
- package/dist/index.mjs +1 -21
- package/dist/react.js +1 -21
- package/dist/react.mjs +1 -21
- package/package.json +1 -1
package/dist/advanced.js
CHANGED
|
@@ -180,24 +180,6 @@ function normalizeCatalogueProductPayload(product) {
|
|
|
180
180
|
const derivedDefaultPrice = readFinalPrice(normalized["default_price_info"]) || readFinalPrice(normalized["price_info"]) || (typeof normalized["final_price"] === "string" || typeof normalized["final_price"] === "number" ? normalized["final_price"] : void 0);
|
|
181
181
|
normalized["default_price"] = derivedDefaultPrice ?? "0";
|
|
182
182
|
}
|
|
183
|
-
const variants = normalized["variants"];
|
|
184
|
-
if (Array.isArray(variants)) {
|
|
185
|
-
normalized["variants"] = variants.map((variant) => {
|
|
186
|
-
if (!isRecord(variant)) return variant;
|
|
187
|
-
const normalizedVariant = { ...variant };
|
|
188
|
-
const variantAdjustment = normalizedVariant["price_adjustment"];
|
|
189
|
-
if (variantAdjustment === void 0 || variantAdjustment === null || variantAdjustment === "") {
|
|
190
|
-
normalizedVariant["price_adjustment"] = readFinalPrice(normalizedVariant["price_info"]) ?? "0";
|
|
191
|
-
}
|
|
192
|
-
if (!normalizedVariant["name"]) {
|
|
193
|
-
const attrs = normalizedVariant["display_attributes"];
|
|
194
|
-
if (Array.isArray(attrs) && attrs.length > 0) {
|
|
195
|
-
normalizedVariant["name"] = attrs.map((a) => a.value_name).filter(Boolean).join(" / ");
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return normalizedVariant;
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
183
|
const addOns = normalized["add_ons"];
|
|
202
184
|
if (Array.isArray(addOns)) {
|
|
203
185
|
normalized["add_ons"] = addOns.map((addOn) => normalizeAddOnPayload(addOn));
|
|
@@ -340,9 +322,7 @@ var CatalogueQueries = class {
|
|
|
340
322
|
return safe(
|
|
341
323
|
this.client.post(
|
|
342
324
|
`/api/v1/catalogue/products/${encodedId}/variants/find`,
|
|
343
|
-
{
|
|
344
|
-
axis_selections: selections
|
|
345
|
-
}
|
|
325
|
+
{ axis_selections: selections }
|
|
346
326
|
)
|
|
347
327
|
);
|
|
348
328
|
}
|
package/dist/advanced.mjs
CHANGED
|
@@ -178,24 +178,6 @@ function normalizeCatalogueProductPayload(product) {
|
|
|
178
178
|
const derivedDefaultPrice = readFinalPrice(normalized["default_price_info"]) || readFinalPrice(normalized["price_info"]) || (typeof normalized["final_price"] === "string" || typeof normalized["final_price"] === "number" ? normalized["final_price"] : void 0);
|
|
179
179
|
normalized["default_price"] = derivedDefaultPrice ?? "0";
|
|
180
180
|
}
|
|
181
|
-
const variants = normalized["variants"];
|
|
182
|
-
if (Array.isArray(variants)) {
|
|
183
|
-
normalized["variants"] = variants.map((variant) => {
|
|
184
|
-
if (!isRecord(variant)) return variant;
|
|
185
|
-
const normalizedVariant = { ...variant };
|
|
186
|
-
const variantAdjustment = normalizedVariant["price_adjustment"];
|
|
187
|
-
if (variantAdjustment === void 0 || variantAdjustment === null || variantAdjustment === "") {
|
|
188
|
-
normalizedVariant["price_adjustment"] = readFinalPrice(normalizedVariant["price_info"]) ?? "0";
|
|
189
|
-
}
|
|
190
|
-
if (!normalizedVariant["name"]) {
|
|
191
|
-
const attrs = normalizedVariant["display_attributes"];
|
|
192
|
-
if (Array.isArray(attrs) && attrs.length > 0) {
|
|
193
|
-
normalizedVariant["name"] = attrs.map((a) => a.value_name).filter(Boolean).join(" / ");
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return normalizedVariant;
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
181
|
const addOns = normalized["add_ons"];
|
|
200
182
|
if (Array.isArray(addOns)) {
|
|
201
183
|
normalized["add_ons"] = addOns.map((addOn) => normalizeAddOnPayload(addOn));
|
|
@@ -338,9 +320,7 @@ var CatalogueQueries = class {
|
|
|
338
320
|
return safe(
|
|
339
321
|
this.client.post(
|
|
340
322
|
`/api/v1/catalogue/products/${encodedId}/variants/find`,
|
|
341
|
-
{
|
|
342
|
-
axis_selections: selections
|
|
343
|
-
}
|
|
323
|
+
{ axis_selections: selections }
|
|
344
324
|
)
|
|
345
325
|
);
|
|
346
326
|
}
|
package/dist/index.js
CHANGED
|
@@ -349,24 +349,6 @@ function normalizeCatalogueProductPayload(product) {
|
|
|
349
349
|
const derivedDefaultPrice = readFinalPrice(normalized["default_price_info"]) || readFinalPrice(normalized["price_info"]) || (typeof normalized["final_price"] === "string" || typeof normalized["final_price"] === "number" ? normalized["final_price"] : void 0);
|
|
350
350
|
normalized["default_price"] = derivedDefaultPrice ?? "0";
|
|
351
351
|
}
|
|
352
|
-
const variants = normalized["variants"];
|
|
353
|
-
if (Array.isArray(variants)) {
|
|
354
|
-
normalized["variants"] = variants.map((variant) => {
|
|
355
|
-
if (!isRecord(variant)) return variant;
|
|
356
|
-
const normalizedVariant = { ...variant };
|
|
357
|
-
const variantAdjustment = normalizedVariant["price_adjustment"];
|
|
358
|
-
if (variantAdjustment === void 0 || variantAdjustment === null || variantAdjustment === "") {
|
|
359
|
-
normalizedVariant["price_adjustment"] = readFinalPrice(normalizedVariant["price_info"]) ?? "0";
|
|
360
|
-
}
|
|
361
|
-
if (!normalizedVariant["name"]) {
|
|
362
|
-
const attrs = normalizedVariant["display_attributes"];
|
|
363
|
-
if (Array.isArray(attrs) && attrs.length > 0) {
|
|
364
|
-
normalizedVariant["name"] = attrs.map((a) => a.value_name).filter(Boolean).join(" / ");
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return normalizedVariant;
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
352
|
const addOns = normalized["add_ons"];
|
|
371
353
|
if (Array.isArray(addOns)) {
|
|
372
354
|
normalized["add_ons"] = addOns.map((addOn) => normalizeAddOnPayload(addOn));
|
|
@@ -509,9 +491,7 @@ var CatalogueQueries = class {
|
|
|
509
491
|
return safe(
|
|
510
492
|
this.client.post(
|
|
511
493
|
`/api/v1/catalogue/products/${encodedId}/variants/find`,
|
|
512
|
-
{
|
|
513
|
-
axis_selections: selections
|
|
514
|
-
}
|
|
494
|
+
{ axis_selections: selections }
|
|
515
495
|
)
|
|
516
496
|
);
|
|
517
497
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -347,24 +347,6 @@ function normalizeCatalogueProductPayload(product) {
|
|
|
347
347
|
const derivedDefaultPrice = readFinalPrice(normalized["default_price_info"]) || readFinalPrice(normalized["price_info"]) || (typeof normalized["final_price"] === "string" || typeof normalized["final_price"] === "number" ? normalized["final_price"] : void 0);
|
|
348
348
|
normalized["default_price"] = derivedDefaultPrice ?? "0";
|
|
349
349
|
}
|
|
350
|
-
const variants = normalized["variants"];
|
|
351
|
-
if (Array.isArray(variants)) {
|
|
352
|
-
normalized["variants"] = variants.map((variant) => {
|
|
353
|
-
if (!isRecord(variant)) return variant;
|
|
354
|
-
const normalizedVariant = { ...variant };
|
|
355
|
-
const variantAdjustment = normalizedVariant["price_adjustment"];
|
|
356
|
-
if (variantAdjustment === void 0 || variantAdjustment === null || variantAdjustment === "") {
|
|
357
|
-
normalizedVariant["price_adjustment"] = readFinalPrice(normalizedVariant["price_info"]) ?? "0";
|
|
358
|
-
}
|
|
359
|
-
if (!normalizedVariant["name"]) {
|
|
360
|
-
const attrs = normalizedVariant["display_attributes"];
|
|
361
|
-
if (Array.isArray(attrs) && attrs.length > 0) {
|
|
362
|
-
normalizedVariant["name"] = attrs.map((a) => a.value_name).filter(Boolean).join(" / ");
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
return normalizedVariant;
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
350
|
const addOns = normalized["add_ons"];
|
|
369
351
|
if (Array.isArray(addOns)) {
|
|
370
352
|
normalized["add_ons"] = addOns.map((addOn) => normalizeAddOnPayload(addOn));
|
|
@@ -507,9 +489,7 @@ var CatalogueQueries = class {
|
|
|
507
489
|
return safe(
|
|
508
490
|
this.client.post(
|
|
509
491
|
`/api/v1/catalogue/products/${encodedId}/variants/find`,
|
|
510
|
-
{
|
|
511
|
-
axis_selections: selections
|
|
512
|
-
}
|
|
492
|
+
{ axis_selections: selections }
|
|
513
493
|
)
|
|
514
494
|
);
|
|
515
495
|
}
|
package/dist/react.js
CHANGED
|
@@ -603,24 +603,6 @@ function normalizeCatalogueProductPayload(product) {
|
|
|
603
603
|
const derivedDefaultPrice = readFinalPrice(normalized["default_price_info"]) || readFinalPrice(normalized["price_info"]) || (typeof normalized["final_price"] === "string" || typeof normalized["final_price"] === "number" ? normalized["final_price"] : void 0);
|
|
604
604
|
normalized["default_price"] = derivedDefaultPrice ?? "0";
|
|
605
605
|
}
|
|
606
|
-
const variants = normalized["variants"];
|
|
607
|
-
if (Array.isArray(variants)) {
|
|
608
|
-
normalized["variants"] = variants.map((variant) => {
|
|
609
|
-
if (!isRecord(variant)) return variant;
|
|
610
|
-
const normalizedVariant = { ...variant };
|
|
611
|
-
const variantAdjustment = normalizedVariant["price_adjustment"];
|
|
612
|
-
if (variantAdjustment === void 0 || variantAdjustment === null || variantAdjustment === "") {
|
|
613
|
-
normalizedVariant["price_adjustment"] = readFinalPrice(normalizedVariant["price_info"]) ?? "0";
|
|
614
|
-
}
|
|
615
|
-
if (!normalizedVariant["name"]) {
|
|
616
|
-
const attrs = normalizedVariant["display_attributes"];
|
|
617
|
-
if (Array.isArray(attrs) && attrs.length > 0) {
|
|
618
|
-
normalizedVariant["name"] = attrs.map((a) => a.value_name).filter(Boolean).join(" / ");
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
return normalizedVariant;
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
606
|
const addOns = normalized["add_ons"];
|
|
625
607
|
if (Array.isArray(addOns)) {
|
|
626
608
|
normalized["add_ons"] = addOns.map((addOn) => normalizeAddOnPayload(addOn));
|
|
@@ -763,9 +745,7 @@ var CatalogueQueries = class {
|
|
|
763
745
|
return safe(
|
|
764
746
|
this.client.post(
|
|
765
747
|
`/api/v1/catalogue/products/${encodedId}/variants/find`,
|
|
766
|
-
{
|
|
767
|
-
axis_selections: selections
|
|
768
|
-
}
|
|
748
|
+
{ axis_selections: selections }
|
|
769
749
|
)
|
|
770
750
|
);
|
|
771
751
|
}
|
package/dist/react.mjs
CHANGED
|
@@ -597,24 +597,6 @@ function normalizeCatalogueProductPayload(product) {
|
|
|
597
597
|
const derivedDefaultPrice = readFinalPrice(normalized["default_price_info"]) || readFinalPrice(normalized["price_info"]) || (typeof normalized["final_price"] === "string" || typeof normalized["final_price"] === "number" ? normalized["final_price"] : void 0);
|
|
598
598
|
normalized["default_price"] = derivedDefaultPrice ?? "0";
|
|
599
599
|
}
|
|
600
|
-
const variants = normalized["variants"];
|
|
601
|
-
if (Array.isArray(variants)) {
|
|
602
|
-
normalized["variants"] = variants.map((variant) => {
|
|
603
|
-
if (!isRecord(variant)) return variant;
|
|
604
|
-
const normalizedVariant = { ...variant };
|
|
605
|
-
const variantAdjustment = normalizedVariant["price_adjustment"];
|
|
606
|
-
if (variantAdjustment === void 0 || variantAdjustment === null || variantAdjustment === "") {
|
|
607
|
-
normalizedVariant["price_adjustment"] = readFinalPrice(normalizedVariant["price_info"]) ?? "0";
|
|
608
|
-
}
|
|
609
|
-
if (!normalizedVariant["name"]) {
|
|
610
|
-
const attrs = normalizedVariant["display_attributes"];
|
|
611
|
-
if (Array.isArray(attrs) && attrs.length > 0) {
|
|
612
|
-
normalizedVariant["name"] = attrs.map((a) => a.value_name).filter(Boolean).join(" / ");
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
return normalizedVariant;
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
600
|
const addOns = normalized["add_ons"];
|
|
619
601
|
if (Array.isArray(addOns)) {
|
|
620
602
|
normalized["add_ons"] = addOns.map((addOn) => normalizeAddOnPayload(addOn));
|
|
@@ -757,9 +739,7 @@ var CatalogueQueries = class {
|
|
|
757
739
|
return safe(
|
|
758
740
|
this.client.post(
|
|
759
741
|
`/api/v1/catalogue/products/${encodedId}/variants/find`,
|
|
760
|
-
{
|
|
761
|
-
axis_selections: selections
|
|
762
|
-
}
|
|
742
|
+
{ axis_selections: selections }
|
|
763
743
|
)
|
|
764
744
|
);
|
|
765
745
|
}
|