arky-sdk 0.9.12 → 0.9.16

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/README.md +16 -12
  2. package/dist/admin-C-ZTxvz3.d.ts +1544 -0
  3. package/dist/admin-Dm2WRN6q.d.cts +1544 -0
  4. package/dist/admin.cjs +980 -433
  5. package/dist/admin.cjs.map +1 -1
  6. package/dist/admin.d.cts +3 -3
  7. package/dist/admin.d.ts +3 -3
  8. package/dist/admin.js +980 -433
  9. package/dist/admin.js.map +1 -1
  10. package/dist/{api-D4lMmvF0.d.cts → api-D37IpMSq.d.cts} +1415 -671
  11. package/dist/{api-D4lMmvF0.d.ts → api-D37IpMSq.d.ts} +1415 -671
  12. package/dist/index.cjs +1315 -547
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +3 -3
  15. package/dist/index.d.ts +3 -3
  16. package/dist/index.js +1315 -547
  17. package/dist/index.js.map +1 -1
  18. package/dist/{index-Be8suRwP.d.ts → inventory-DdN96PX3.d.cts} +6 -4
  19. package/dist/{index-BS2x278C.d.cts → inventory-Dh1RevEb.d.ts} +6 -4
  20. package/dist/storefront.cjs +1210 -658
  21. package/dist/storefront.cjs.map +1 -1
  22. package/dist/storefront.d.cts +88 -285
  23. package/dist/storefront.d.ts +88 -285
  24. package/dist/storefront.js +1207 -659
  25. package/dist/storefront.js.map +1 -1
  26. package/dist/types.cjs.map +1 -1
  27. package/dist/types.d.cts +1 -1
  28. package/dist/types.d.ts +1 -1
  29. package/dist/types.js.map +1 -1
  30. package/dist/utils.cjs +198 -16
  31. package/dist/utils.cjs.map +1 -1
  32. package/dist/utils.d.cts +18 -2
  33. package/dist/utils.d.ts +18 -2
  34. package/dist/utils.js +191 -17
  35. package/dist/utils.js.map +1 -1
  36. package/package.json +4 -5
  37. package/dist/admin-D8HiRDCl.d.cts +0 -1536
  38. package/dist/admin-Dnnv18wN.d.ts +0 -1536
  39. package/scripts/contract-admin.mjs +0 -137
  40. package/scripts/contract-storefront.mjs +0 -296
package/README.md CHANGED
@@ -44,19 +44,19 @@ await arky.action.track({
44
44
  The storefront module API is the preferred surface for websites:
45
45
 
46
46
  ```typescript
47
- await arky.cart.load();
47
+ await arky.eshop.cart.load();
48
48
 
49
49
  await arky.cms.entry.get({
50
50
  collection_id: "pages",
51
51
  key: "homepage",
52
52
  locale: "en",
53
53
  });
54
- await arky.cms.form.submitByKey({ key: "contact", entries: [] });
54
+ await arky.cms.form.submitByKey({ key: "contact", values: {} });
55
55
 
56
56
  const { items: products } = await arky.eshop.product.list({ limit: 20 });
57
- await arky.cart.addProduct(products[0], products[0].variants[0], 1);
58
- await arky.cart.quote();
59
- await arky.cart.checkout({ payment_method_id: "cash" });
57
+ await arky.eshop.cart.addProduct(products[0], products[0].variants[0], 1);
58
+ await arky.eshop.cart.quote();
59
+ await arky.eshop.cart.checkout({ payment_method_key: "cash" });
60
60
 
61
61
  const { items: services } = await arky.eshop.service.list({ limit: 20 });
62
62
  await arky.eshop.service.initialize();
@@ -94,10 +94,10 @@ const title = arky.utils.getBlockTextValue(titleBlock, "en");
94
94
 
95
95
  await arky.cms.form.submitByKey({
96
96
  key: "contact",
97
- entries: [
98
- { key: "email", value: "profile@example.com" },
99
- { key: "message", value: "Hello from the storefront" },
100
- ],
97
+ values: {
98
+ email: "profile@example.com",
99
+ message: "Hello from the storefront",
100
+ },
101
101
  });
102
102
  ```
103
103
 
@@ -105,7 +105,7 @@ await arky.cms.form.submitByKey({
105
105
 
106
106
  ```typescript
107
107
  const { items: products } = await arky.eshop.product.list({ limit: 20 });
108
- const product = await arky.eshop.product.loadDetail({ id: products[0].id });
108
+ const product = await arky.eshop.product.get({ id: products[0].id });
109
109
  const variant = product.variants[0];
110
110
 
111
111
  await arky.eshop.cart.addProduct(product, variant, 2);
@@ -113,7 +113,7 @@ await arky.eshop.cart.addProduct(product, variant, 2);
113
113
  const quote = await arky.eshop.cart.quote();
114
114
 
115
115
  const order = await arky.eshop.cart.checkout({
116
- payment_method_id: "credit_card",
116
+ payment_method_key: "credit_card",
117
117
  });
118
118
  ```
119
119
 
@@ -129,15 +129,19 @@ arky.eshop.service.findFirstAvailable();
129
129
  const state = arky.eshop.service.state.get();
130
130
  if (state.slots[0]) {
131
131
  arky.eshop.service.selectTimeSlot(state.slots[0]);
132
+ const configuredForms = arky.eshop.service.form_groups.get();
133
+ // Render and bind each configuredForms[i].blocks before adding the booking.
132
134
  arky.eshop.service.nextStep();
133
135
  await arky.eshop.service.addToCart();
134
136
  }
135
137
 
136
138
  await arky.eshop.cart.checkout({
137
- payment_method_id: "cash",
139
+ payment_method_key: "cash",
138
140
  });
139
141
  ```
140
142
 
143
+ Booking forms are resolved from the selected service-provider relation by exact form ID. A provider with no configured forms sends `[]`. For a longer booking, pass an explicit list of adjacent slots for the same service and provider to `addToCart(slots)`.
144
+
141
145
  ## Low-Level Client
142
146
 
143
147
  The lower-level SDK client remains available as `arky.client` for admin tools and advanced frontend utilities. Normal storefronts should use the module API first.