@cimplify/sdk 0.19.0 → 0.20.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.
Files changed (40) hide show
  1. package/dist/advanced.d.mts +2 -2
  2. package/dist/advanced.d.ts +2 -2
  3. package/dist/advanced.js +21 -21
  4. package/dist/advanced.mjs +2 -2
  5. package/dist/{chunk-RYQ5IPWX.js → chunk-2BSYTQAY.js} +18 -28
  6. package/dist/{chunk-AFEE43MQ.mjs → chunk-676BJ3EU.mjs} +43 -8
  7. package/dist/{chunk-7ACYNCNM.mjs → chunk-7KH2XJIW.mjs} +55 -12
  8. package/dist/{chunk-B2RTVYJR.js → chunk-AVVLN353.js} +76 -40
  9. package/dist/{chunk-FTL2SXCG.mjs → chunk-HG7GG3TT.mjs} +18 -28
  10. package/dist/{chunk-6SRY4DPY.js → chunk-KSN3RJFL.js} +74 -30
  11. package/dist/{client-FNZzXO_v.d.ts → client-D4E9aJy7.d.mts} +139 -7
  12. package/dist/{client-B3payjUV.d.mts → client-VyO6Bqz2.d.ts} +139 -7
  13. package/dist/index.d.mts +38 -5
  14. package/dist/index.d.ts +38 -5
  15. package/dist/index.js +101 -97
  16. package/dist/index.mjs +3 -3
  17. package/dist/{payment-CO2tRThu.d.mts → payment-CKqMU4xT.d.mts} +1051 -943
  18. package/dist/{payment-CO2tRThu.d.ts → payment-CKqMU4xT.d.ts} +1051 -943
  19. package/dist/{price-Bp6JlVzW.d.ts → price-BqV_DjjQ.d.mts} +1 -1
  20. package/dist/{price-Dg7MJEsL.d.mts → price-e4beObLZ.d.ts} +1 -1
  21. package/dist/react.d.mts +463 -11
  22. package/dist/react.d.ts +463 -11
  23. package/dist/react.js +1630 -113
  24. package/dist/react.mjs +1566 -65
  25. package/dist/styles.css +1 -1
  26. package/dist/utils.d.mts +2 -2
  27. package/dist/utils.d.ts +2 -2
  28. package/dist/utils.js +28 -28
  29. package/dist/utils.mjs +1 -1
  30. package/package.json +2 -2
  31. package/registry/availability-badge.json +1 -1
  32. package/registry/booking-page.json +1 -1
  33. package/registry/bundle-selector.json +1 -1
  34. package/registry/cart-summary.json +1 -1
  35. package/registry/composite-selector.json +1 -1
  36. package/registry/order-summary.json +1 -1
  37. package/registry/product-customizer.json +1 -1
  38. package/registry/search-input.json +1 -1
  39. package/registry/service-card.json +1 -1
  40. package/registry/variant-selector.json +1 -1
@@ -1,5 +1,5 @@
1
- export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, k as CheckoutOperations, k as CheckoutService, w as CimplifyElement, v as CimplifyElements, y as ELEMENT_TYPES, E as EVENT_TYPES, J as ElementEventType, D as ElementOptions, H as ElementType, z as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, S as SchedulingService, x as createElements, l as generateIdempotencyKey } from './client-B3payjUV.mjs';
2
- import './payment-CO2tRThu.mjs';
1
+ export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, k as CheckoutOperations, k as CheckoutService, K as CimplifyElement, J as CimplifyElements, W as ELEMENT_TYPES, V as EVENT_TYPES, _ as ElementEventType, Y as ElementOptions, Z as ElementType, X as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, N as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, S as SchedulingService, M as createElements, l as generateIdempotencyKey } from './client-D4E9aJy7.mjs';
2
+ import './payment-CKqMU4xT.mjs';
3
3
 
4
4
  type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
5
5
  type SortOrder = "asc" | "desc";
@@ -1,5 +1,5 @@
1
- export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, k as CheckoutOperations, k as CheckoutService, w as CimplifyElement, v as CimplifyElements, y as ELEMENT_TYPES, E as EVENT_TYPES, J as ElementEventType, D as ElementOptions, H as ElementType, z as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, S as SchedulingService, x as createElements, l as generateIdempotencyKey } from './client-FNZzXO_v.js';
2
- import './payment-CO2tRThu.js';
1
+ export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, k as CheckoutOperations, k as CheckoutService, K as CimplifyElement, J as CimplifyElements, W as ELEMENT_TYPES, V as EVENT_TYPES, _ as ElementEventType, Y as ElementOptions, Z as ElementType, X as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, N as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, S as SchedulingService, M as createElements, l as generateIdempotencyKey } from './client-VyO6Bqz2.js';
2
+ import './payment-CKqMU4xT.js';
3
3
 
4
4
  type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
5
5
  type SortOrder = "asc" | "desc";
package/dist/advanced.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkFLPI2VVJ_js = require('./chunk-FLPI2VVJ.js');
4
- var chunk6SRY4DPY_js = require('./chunk-6SRY4DPY.js');
5
- require('./chunk-RYQ5IPWX.js');
4
+ var chunkKSN3RJFL_js = require('./chunk-KSN3RJFL.js');
5
+ require('./chunk-2BSYTQAY.js');
6
6
 
7
7
 
8
8
 
@@ -16,77 +16,77 @@ Object.defineProperty(exports, "query", {
16
16
  });
17
17
  Object.defineProperty(exports, "AuthService", {
18
18
  enumerable: true,
19
- get: function () { return chunk6SRY4DPY_js.AuthService; }
19
+ get: function () { return chunkKSN3RJFL_js.AuthService; }
20
20
  });
21
21
  Object.defineProperty(exports, "BusinessService", {
22
22
  enumerable: true,
23
- get: function () { return chunk6SRY4DPY_js.BusinessService; }
23
+ get: function () { return chunkKSN3RJFL_js.BusinessService; }
24
24
  });
25
25
  Object.defineProperty(exports, "CartOperations", {
26
26
  enumerable: true,
27
- get: function () { return chunk6SRY4DPY_js.CartOperations; }
27
+ get: function () { return chunkKSN3RJFL_js.CartOperations; }
28
28
  });
29
29
  Object.defineProperty(exports, "CatalogueQueries", {
30
30
  enumerable: true,
31
- get: function () { return chunk6SRY4DPY_js.CatalogueQueries; }
31
+ get: function () { return chunkKSN3RJFL_js.CatalogueQueries; }
32
32
  });
33
33
  Object.defineProperty(exports, "CheckoutOperations", {
34
34
  enumerable: true,
35
- get: function () { return chunk6SRY4DPY_js.CheckoutService; }
35
+ get: function () { return chunkKSN3RJFL_js.CheckoutService; }
36
36
  });
37
37
  Object.defineProperty(exports, "CheckoutService", {
38
38
  enumerable: true,
39
- get: function () { return chunk6SRY4DPY_js.CheckoutService; }
39
+ get: function () { return chunkKSN3RJFL_js.CheckoutService; }
40
40
  });
41
41
  Object.defineProperty(exports, "CimplifyElement", {
42
42
  enumerable: true,
43
- get: function () { return chunk6SRY4DPY_js.CimplifyElement; }
43
+ get: function () { return chunkKSN3RJFL_js.CimplifyElement; }
44
44
  });
45
45
  Object.defineProperty(exports, "CimplifyElements", {
46
46
  enumerable: true,
47
- get: function () { return chunk6SRY4DPY_js.CimplifyElements; }
47
+ get: function () { return chunkKSN3RJFL_js.CimplifyElements; }
48
48
  });
49
49
  Object.defineProperty(exports, "ELEMENT_TYPES", {
50
50
  enumerable: true,
51
- get: function () { return chunk6SRY4DPY_js.ELEMENT_TYPES; }
51
+ get: function () { return chunkKSN3RJFL_js.ELEMENT_TYPES; }
52
52
  });
53
53
  Object.defineProperty(exports, "EVENT_TYPES", {
54
54
  enumerable: true,
55
- get: function () { return chunk6SRY4DPY_js.EVENT_TYPES; }
55
+ get: function () { return chunkKSN3RJFL_js.EVENT_TYPES; }
56
56
  });
57
57
  Object.defineProperty(exports, "FxService", {
58
58
  enumerable: true,
59
- get: function () { return chunk6SRY4DPY_js.FxService; }
59
+ get: function () { return chunkKSN3RJFL_js.FxService; }
60
60
  });
61
61
  Object.defineProperty(exports, "InventoryService", {
62
62
  enumerable: true,
63
- get: function () { return chunk6SRY4DPY_js.InventoryService; }
63
+ get: function () { return chunkKSN3RJFL_js.InventoryService; }
64
64
  });
65
65
  Object.defineProperty(exports, "LinkService", {
66
66
  enumerable: true,
67
- get: function () { return chunk6SRY4DPY_js.LinkService; }
67
+ get: function () { return chunkKSN3RJFL_js.LinkService; }
68
68
  });
69
69
  Object.defineProperty(exports, "LiteService", {
70
70
  enumerable: true,
71
- get: function () { return chunk6SRY4DPY_js.LiteService; }
71
+ get: function () { return chunkKSN3RJFL_js.LiteService; }
72
72
  });
73
73
  Object.defineProperty(exports, "MESSAGE_TYPES", {
74
74
  enumerable: true,
75
- get: function () { return chunk6SRY4DPY_js.MESSAGE_TYPES; }
75
+ get: function () { return chunkKSN3RJFL_js.MESSAGE_TYPES; }
76
76
  });
77
77
  Object.defineProperty(exports, "OrderQueries", {
78
78
  enumerable: true,
79
- get: function () { return chunk6SRY4DPY_js.OrderQueries; }
79
+ get: function () { return chunkKSN3RJFL_js.OrderQueries; }
80
80
  });
81
81
  Object.defineProperty(exports, "SchedulingService", {
82
82
  enumerable: true,
83
- get: function () { return chunk6SRY4DPY_js.SchedulingService; }
83
+ get: function () { return chunkKSN3RJFL_js.SchedulingService; }
84
84
  });
85
85
  Object.defineProperty(exports, "createElements", {
86
86
  enumerable: true,
87
- get: function () { return chunk6SRY4DPY_js.createElements; }
87
+ get: function () { return chunkKSN3RJFL_js.createElements; }
88
88
  });
89
89
  Object.defineProperty(exports, "generateIdempotencyKey", {
90
90
  enumerable: true,
91
- get: function () { return chunk6SRY4DPY_js.generateIdempotencyKey; }
91
+ get: function () { return chunkKSN3RJFL_js.generateIdempotencyKey; }
92
92
  });
package/dist/advanced.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  export { QueryBuilder, query } from './chunk-LM3CJ4L7.mjs';
2
- export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-7ACYNCNM.mjs';
3
- import './chunk-FTL2SXCG.mjs';
2
+ export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-7KH2XJIW.mjs';
3
+ import './chunk-HG7GG3TT.mjs';
@@ -552,26 +552,29 @@ var PAYMENT_REQUIRES_ACTION_STATUSES = /* @__PURE__ */ new Set([
552
552
  "requires_capture"
553
553
  ]);
554
554
  var PAYMENT_STATUS_ALIAS_MAP = {
555
- ok: "success",
556
- done: "success",
557
- paid: "paid",
558
- paid_in_full: "paid",
559
- paid_successfully: "paid",
560
- succeeded: "success",
555
+ ok: "captured",
556
+ done: "captured",
557
+ paid: "captured",
558
+ paid_in_full: "captured",
559
+ paid_successfully: "captured",
560
+ succeeded: "captured",
561
+ success: "captured",
561
562
  captured: "captured",
562
- completed: "completed",
563
- pending_confirmation: "pending_confirmation",
563
+ completed: "captured",
564
+ pending_confirmation: "pending",
564
565
  requires_authorization: "requires_action",
565
566
  requires_action: "requires_action",
566
- requires_payment_method: "requires_payment_method",
567
- requires_capture: "requires_capture",
568
- partially_paid: "partially_paid",
569
- partially_refunded: "partially_refunded",
570
- card_declined: "declined",
567
+ requires_payment_method: "requires_action",
568
+ requires_capture: "authorized",
569
+ partially_paid: "pending",
570
+ partially_refunded: "refunded",
571
+ card_declined: "failed",
572
+ declined: "failed",
571
573
  canceled: "cancelled",
572
574
  authorized: "authorized",
573
575
  cancelled: "cancelled",
574
- unresolved: "pending"
576
+ unresolved: "pending",
577
+ error: "failed"
575
578
  };
576
579
  var KNOWN_PAYMENT_STATUSES = /* @__PURE__ */ new Set([
577
580
  "initialized",
@@ -588,20 +591,7 @@ var KNOWN_PAYMENT_STATUSES = /* @__PURE__ */ new Set([
588
591
  "abandoned",
589
592
  "reversed",
590
593
  "disputed",
591
- "refund_pending",
592
- "created",
593
- "pending_confirmation",
594
- "success",
595
- "succeeded",
596
- "declined",
597
- "partially_refunded",
598
- "partially_paid",
599
- "paid",
600
- "unpaid",
601
- "requires_payment_method",
602
- "requires_capture",
603
- "completed",
604
- "error"
594
+ "refund_pending"
605
595
  ]);
606
596
  function normalizeStatusToken(status) {
607
597
  return status?.trim().toLowerCase().replace(/[\s-]+/g, "_") ?? "";
@@ -1,5 +1,5 @@
1
- import { CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-7ACYNCNM.mjs';
2
- import { CimplifyError, ErrorCode, enrichError } from './chunk-FTL2SXCG.mjs';
1
+ import { safe, CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-7KH2XJIW.mjs';
2
+ import { CimplifyError, ErrorCode, enrichError } from './chunk-HG7GG3TT.mjs';
3
3
 
4
4
  // src/activity.ts
5
5
  var ActivityService = class {
@@ -26,12 +26,25 @@ var ActivityService = class {
26
26
  };
27
27
  this.sendEvents([event]);
28
28
  }
29
+ async getState() {
30
+ return safe(this.client.get("/api/v1/activity/state"));
31
+ }
32
+ async getRecommendations(options) {
33
+ const params = new URLSearchParams();
34
+ if (options?.location_id) params.set("location_id", options.location_id);
35
+ if (options?.limit) params.set("limit", String(options.limit));
36
+ const query = params.toString();
37
+ const path = query ? `/api/v1/activity/recommendations?${query}` : "/api/v1/activity/recommendations";
38
+ return safe(this.client.get(path));
39
+ }
40
+ async dismissMessage(code) {
41
+ return safe(
42
+ this.client.post("/api/v1/activity/messages/dismiss", { code })
43
+ );
44
+ }
29
45
  sendEvents(events) {
30
- try {
31
- this.client.post("/api/v1/activity/events", { events }).catch(() => {
32
- });
33
- } catch {
34
- }
46
+ this.client.post("/api/v1/activity/events", { events }).catch(() => {
47
+ });
35
48
  }
36
49
  };
37
50
  function currentPath() {
@@ -41,6 +54,22 @@ function currentPath() {
41
54
  return void 0;
42
55
  }
43
56
 
57
+ // src/delivery.ts
58
+ var DeliveryService = class {
59
+ constructor(client) {
60
+ this.client = client;
61
+ }
62
+ async getFee(dropoffLat, dropoffLng, country) {
63
+ const params = new URLSearchParams();
64
+ params.set("dropoff_lat", String(dropoffLat));
65
+ params.set("dropoff_lng", String(dropoffLng));
66
+ if (country) params.set("country", country);
67
+ return safe(
68
+ this.client.get(`/api/v1/delivery/fee?${params.toString()}`)
69
+ );
70
+ }
71
+ };
72
+
44
73
  // src/client.ts
45
74
  var ACCESS_TOKEN_STORAGE_KEY = "cimplify_access_token";
46
75
  var SESSION_TOKEN_STORAGE_KEY = "cimplify_session_token";
@@ -636,6 +665,12 @@ var CimplifyClient = class {
636
665
  }
637
666
  return this._activity;
638
667
  }
668
+ get delivery() {
669
+ if (!this._delivery) {
670
+ this._delivery = new DeliveryService(this);
671
+ }
672
+ return this._delivery;
673
+ }
639
674
  elements(businessId, options) {
640
675
  if (businessId) {
641
676
  this.setBusinessId(businessId);
@@ -684,4 +719,4 @@ function getVariantDisplayName(variant, productName) {
684
719
  return productName || (variant.is_default ? "Default" : "Option");
685
720
  }
686
721
 
687
- export { ActivityService, CimplifyClient, createCimplifyClient, getVariantDisplayName };
722
+ export { ActivityService, CimplifyClient, DeliveryService, createCimplifyClient, getVariantDisplayName };
@@ -1,4 +1,4 @@
1
- import { CimplifyError, currencyCode, ErrorCode, isPaymentStatusRequiresAction, normalizeStatusResponse, isPaymentStatusSuccess, isPaymentStatusFailure, getErrorHint, enrichError } from './chunk-FTL2SXCG.mjs';
1
+ import { CimplifyError, currencyCode, ErrorCode, enrichError, isPaymentStatusRequiresAction, normalizeStatusResponse, isPaymentStatusSuccess, isPaymentStatusFailure, getErrorHint } from './chunk-HG7GG3TT.mjs';
2
2
 
3
3
  // src/types/result.ts
4
4
  function ok(value) {
@@ -275,10 +275,7 @@ var CatalogueQueries = class {
275
275
  return ok(normalizeCatalogueProductPayload(result.value));
276
276
  }
277
277
  async getProductBySlug(slug) {
278
- const encodedSlug = encodeURIComponent(slug);
279
- const result = await safe(this.client.get(`/api/v1/catalogue/products/slug/${encodedSlug}`));
280
- if (!result.ok) return result;
281
- return ok(normalizeCatalogueProductPayload(result.value));
278
+ return this.getProduct(slug);
282
279
  }
283
280
  async getVariants(productId) {
284
281
  const encodedId = encodeURIComponent(productId);
@@ -318,8 +315,7 @@ var CatalogueQueries = class {
318
315
  return safe(this.client.get(`/api/v1/catalogue/categories/${encodedId}`));
319
316
  }
320
317
  async getCategoryBySlug(slug) {
321
- const encodedSlug = encodeURIComponent(slug);
322
- return safe(this.client.get(`/api/v1/catalogue/categories/slug/${encodedSlug}`));
318
+ return this.getCategory(slug);
323
319
  }
324
320
  async getCategoryProducts(categoryId, options) {
325
321
  const encodedId = encodeURIComponent(categoryId);
@@ -337,8 +333,7 @@ var CatalogueQueries = class {
337
333
  return safe(this.client.get(`/api/v1/catalogue/collections/${encodedId}`));
338
334
  }
339
335
  async getCollectionBySlug(slug) {
340
- const encodedSlug = encodeURIComponent(slug);
341
- return safe(this.client.get(`/api/v1/catalogue/collections/slug/${encodedSlug}`));
336
+ return this.getCollection(slug);
342
337
  }
343
338
  async getCollectionProducts(collectionId, options) {
344
339
  const encodedId = encodeURIComponent(collectionId);
@@ -355,6 +350,13 @@ var CatalogueQueries = class {
355
350
  async getBundles() {
356
351
  return safe(this.client.get("/api/v1/catalogue/bundles"));
357
352
  }
353
+ async getBundle(id) {
354
+ const encodedId = encodeURIComponent(id);
355
+ return safe(this.client.get(`/api/v1/catalogue/bundles/${encodedId}`));
356
+ }
357
+ async getBundleBySlug(slug) {
358
+ return this.getBundle(slug);
359
+ }
358
360
  async searchBundles(query, limit = 20) {
359
361
  const path = withQuery("/api/v1/catalogue/bundles", { search: query, limit });
360
362
  return safe(this.client.get(path));
@@ -363,6 +365,14 @@ var CatalogueQueries = class {
363
365
  const path = withQuery("/api/v1/catalogue/composites", { limit: options?.limit });
364
366
  return safe(this.client.get(path));
365
367
  }
368
+ async getComposite(id) {
369
+ const encodedId = encodeURIComponent(id);
370
+ return safe(this.client.get(`/api/v1/catalogue/composites/${encodedId}`));
371
+ }
372
+ async getCompositeByProduct(productId) {
373
+ const encodedId = encodeURIComponent(productId);
374
+ return safe(this.client.get(`/api/v1/catalogue/composites/by-product/${encodedId}`));
375
+ }
366
376
  async calculateCompositePrice(compositeId, selections, locationId) {
367
377
  const encodedId = encodeURIComponent(compositeId);
368
378
  return safe(
@@ -407,6 +417,15 @@ var CatalogueQueries = class {
407
417
  const path = withQuery("/api/v1/catalogue/taxonomies/search", { q: query, limit });
408
418
  return safe(this.client.get(path));
409
419
  }
420
+ async getEligibleBillingPlans(productId, query) {
421
+ const encodedId = encodeURIComponent(productId);
422
+ const path = withQuery(`/api/v1/catalogue/products/${encodedId}/billing-plans/eligible`, {
423
+ customer_id: query?.customer_id,
424
+ quantity: query?.quantity,
425
+ order_value: query?.order_value
426
+ });
427
+ return safe(this.client.get(path));
428
+ }
410
429
  async getProductSchedules(productId) {
411
430
  const encodedId = encodeURIComponent(productId);
412
431
  return safe(this.client.get(`/api/v1/catalogue/products/${encodedId}/schedules`));
@@ -481,8 +500,32 @@ var CatalogueQueries = class {
481
500
  });
482
501
  return safe(this.client.get(path));
483
502
  }
484
- async getAttributeDefinitions() {
485
- return safe(this.client.get("/api/v1/catalogue/attributes"));
503
+ async getAttributeDefinitions(namespace) {
504
+ const params = namespace ? `?namespace=${encodeURIComponent(namespace)}` : "";
505
+ return safe(
506
+ this.client.get(`/api/v1/catalogue/attributes${params}`)
507
+ );
508
+ }
509
+ async getProductAttributes(productId) {
510
+ return safe(
511
+ this.client.get(
512
+ `/api/v1/catalogue/products/${productId}/attributes`
513
+ )
514
+ );
515
+ }
516
+ async getCategoryAttributes(categoryId) {
517
+ return safe(
518
+ this.client.get(
519
+ `/api/v1/catalogue/categories/${categoryId}/attributes`
520
+ )
521
+ );
522
+ }
523
+ async getCollectionAttributes(collectionId) {
524
+ return safe(
525
+ this.client.get(
526
+ `/api/v1/catalogue/collections/${collectionId}/attributes`
527
+ )
528
+ );
486
529
  }
487
530
  async getPropertyFacets(options) {
488
531
  const path = withQuery("/api/v1/catalogue/properties/facets", {
@@ -2795,4 +2838,4 @@ function createElements(client, businessId, options) {
2795
2838
  return new CimplifyElements(client, businessId, options);
2796
2839
  }
2797
2840
 
2798
- export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, toNullable, tryCatch, unwrap };
2841
+ export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, safe, toNullable, tryCatch, unwrap };