arky-sdk 0.9.13 → 0.9.17
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 +16 -12
- package/dist/admin-6xpHuyKc.d.cts +1544 -0
- package/dist/admin-DVFAgnHm.d.ts +1544 -0
- package/dist/admin.cjs +982 -425
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.d.cts +3 -3
- package/dist/admin.d.ts +3 -3
- package/dist/admin.js +982 -425
- package/dist/admin.js.map +1 -1
- package/dist/{api-DvsFdOaF.d.cts → api-DJrUdQ1C.d.cts} +1425 -657
- package/dist/{api-DvsFdOaF.d.ts → api-DJrUdQ1C.d.ts} +1425 -657
- package/dist/index.cjs +1317 -539
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1317 -539
- package/dist/index.js.map +1 -1
- package/dist/{index-CQd9b_7n.d.ts → inventory-DOwNF3D-.d.cts} +6 -4
- package/dist/{index-BC06yiuv.d.cts → inventory-GpWTZ2oe.d.ts} +6 -4
- package/dist/storefront.cjs +1210 -658
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.d.cts +88 -285
- package/dist/storefront.d.ts +88 -285
- package/dist/storefront.js +1207 -659
- package/dist/storefront.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +198 -16
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +18 -2
- package/dist/utils.d.ts +18 -2
- package/dist/utils.js +191 -17
- package/dist/utils.js.map +1 -1
- package/package.json +4 -5
- package/dist/admin-Q9MBFwCb.d.cts +0 -1496
- package/dist/admin-ZLXD4_en.d.ts +0 -1496
- package/scripts/contract-admin.mjs +0 -120
- 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",
|
|
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({
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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.
|