@doswiftly/cli 0.2.6 → 1.0.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 (30) hide show
  1. package/CHANGELOG.md +639 -0
  2. package/package.json +1 -1
  3. package/templates/storefront-nextjs-shadcn/app/[locale]/account/addresses/page.tsx +10 -10
  4. package/templates/storefront-nextjs-shadcn/app/[locale]/account/orders/[id]/page.tsx +9 -9
  5. package/templates/storefront-nextjs-shadcn/app/[locale]/account/orders/[id]/tracking/page.tsx +1 -1
  6. package/templates/storefront-nextjs-shadcn/app/[locale]/account/orders/page.tsx +2 -2
  7. package/templates/storefront-nextjs-shadcn/app/[locale]/account/settings/page.tsx +3 -3
  8. package/templates/storefront-nextjs-shadcn/app/[locale]/checkout/page.tsx +41 -41
  9. package/templates/storefront-nextjs-shadcn/app/[locale]/products/[slug]/product-client.tsx +1 -1
  10. package/templates/storefront-nextjs-shadcn/app/api/auth/whoami/route.ts +6 -0
  11. package/templates/storefront-nextjs-shadcn/components/account/address-form.tsx +43 -43
  12. package/templates/storefront-nextjs-shadcn/components/account/address-list.tsx +9 -9
  13. package/templates/storefront-nextjs-shadcn/components/account/customer-info.fragment.graphql +5 -5
  14. package/templates/storefront-nextjs-shadcn/components/account/order-details.tsx +8 -8
  15. package/templates/storefront-nextjs-shadcn/components/account/order-history.tsx +2 -2
  16. package/templates/storefront-nextjs-shadcn/components/account/order-summary.fragment.graphql +15 -13
  17. package/templates/storefront-nextjs-shadcn/components/cart/cart-line.fragment.graphql +6 -6
  18. package/templates/storefront-nextjs-shadcn/components/discount/discount-code-input.tsx +10 -10
  19. package/templates/storefront-nextjs-shadcn/components/gift-card/gift-card-input.tsx +9 -9
  20. package/templates/storefront-nextjs-shadcn/components/order/delivery-estimate.tsx +2 -2
  21. package/templates/storefront-nextjs-shadcn/components/product/product-card.tsx +1 -1
  22. package/templates/storefront-nextjs-shadcn/components/seo/product-json-ld.ts +1 -1
  23. package/templates/storefront-nextjs-shadcn/hooks/use-auth-sync.ts +43 -25
  24. package/templates/storefront-nextjs-shadcn/hooks/use-cart-actions.ts +1 -1
  25. package/templates/storefront-nextjs-shadcn/hooks/use-cart-sync.ts +14 -14
  26. package/templates/storefront-nextjs-shadcn/lib/graphql/hooks.ts +24 -35
  27. package/templates/storefront-nextjs-shadcn/lib/graphql/server.ts +21 -4
  28. package/templates/storefront-nextjs-shadcn/messages/en.json +6 -6
  29. package/templates/storefront-nextjs-shadcn/messages/pl.json +6 -6
  30. package/templates/storefront-nextjs-shadcn/stores/checkout-store.ts +8 -8
@@ -78,20 +78,20 @@ export default function OrderDetailPage() {
78
78
  date: new Date(order.processedAt).toLocaleDateString(),
79
79
  status: mapFulfillmentStatus(order.fulfillmentStatus),
80
80
  items: [],
81
- subtotal: order.subtotalPrice?.amount || "0",
82
- shipping: order.totalShipping?.amount || "0",
83
- tax: order.totalTax?.amount || "0",
84
- total: order.totalPrice.amount,
85
- currency: order.totalPrice.currencyCode,
81
+ subtotal: order.totals.subtotal?.amount || "0",
82
+ shipping: order.totals.totalShipping?.amount || "0",
83
+ tax: order.totals.totalTax?.amount || "0",
84
+ total: order.totals.total.amount,
85
+ currency: order.totals.total.currencyCode,
86
86
  shippingAddress: order.shippingAddress
87
87
  ? {
88
88
  firstName: order.shippingAddress.firstName || "",
89
89
  lastName: order.shippingAddress.lastName || "",
90
- address1: order.shippingAddress.address1 || "",
91
- address2: order.shippingAddress.address2 || "",
90
+ streetLine1: order.shippingAddress.streetLine1 || "",
91
+ streetLine2: order.shippingAddress.streetLine2 || "",
92
92
  city: order.shippingAddress.city || "",
93
- province: order.shippingAddress.province || "",
94
- zip: order.shippingAddress.zip || "",
93
+ state: order.shippingAddress.state || "",
94
+ postalCode: order.shippingAddress.postalCode || "",
95
95
  country: order.shippingAddress.country || "",
96
96
  phone: order.shippingAddress.phone || "",
97
97
  }
@@ -35,7 +35,7 @@ export default function OrderTrackingPage() {
35
35
  lastUpdate: "2024-01-18T14:30:00Z",
36
36
  deliveryAddress: {
37
37
  city: "Warsaw",
38
- province: "Mazowieckie",
38
+ state: "Mazowieckie",
39
39
  country: "Poland",
40
40
  },
41
41
  };
@@ -13,7 +13,7 @@ export default function OrdersPage() {
13
13
  const t = useTranslations("account");
14
14
  const hydrated = useHydrated();
15
15
  const authHydrated = useAuthHydrated();
16
- const accessToken = useAuthStore((s) => s.accessToken);
16
+ const isAuthenticated = useAuthStore((s) => s.isAuthenticated);
17
17
 
18
18
  const { data, isPending, error } = useCustomer();
19
19
 
@@ -53,7 +53,7 @@ export default function OrdersPage() {
53
53
  );
54
54
  }
55
55
 
56
- if (!accessToken) {
56
+ if (!isAuthenticated) {
57
57
  return (
58
58
  <div className="container mx-auto px-4 py-8">
59
59
  <Breadcrumbs className="mb-6" />
@@ -15,7 +15,7 @@ import { Skeleton } from "@/components/ui/skeleton";
15
15
  export default function SettingsPage() {
16
16
  const hydrated = useHydrated();
17
17
  const authHydrated = useAuthHydrated();
18
- const accessToken = useAuthStore((s) => s.accessToken);
18
+ const isAuthenticated = useAuthStore((s) => s.isAuthenticated);
19
19
  const updateAuthStore = useAuthStore((s) => s.updateCustomer);
20
20
 
21
21
  const [firstName, setFirstName] = useState("");
@@ -58,7 +58,7 @@ export default function SettingsPage() {
58
58
 
59
59
  const handleSave = (e: React.FormEvent) => {
60
60
  e.preventDefault();
61
- if (!accessToken) return;
61
+ if (!isAuthenticated) return;
62
62
  updateMutation.mutate({
63
63
  firstName: firstName || undefined,
64
64
  lastName: lastName || undefined,
@@ -92,7 +92,7 @@ export default function SettingsPage() {
92
92
  );
93
93
  }
94
94
 
95
- if (!accessToken) {
95
+ if (!isAuthenticated) {
96
96
  return (
97
97
  <div className="container mx-auto px-4 py-8">
98
98
  <Breadcrumbs className="mb-6" />
@@ -81,11 +81,11 @@ interface ShippingRate {
81
81
  interface AddressForm {
82
82
  firstName: string;
83
83
  lastName: string;
84
- address1: string;
85
- address2: string;
84
+ streetLine1: string;
85
+ streetLine2: string;
86
86
  city: string;
87
- province: string;
88
- zip: string;
87
+ state: string;
88
+ postalCode: string;
89
89
  country: string;
90
90
  phone: string;
91
91
  company: string;
@@ -109,11 +109,11 @@ interface CheckoutFormState {
109
109
  const emptyAddress: AddressForm = {
110
110
  firstName: "",
111
111
  lastName: "",
112
- address1: "",
113
- address2: "",
112
+ streetLine1: "",
113
+ streetLine2: "",
114
114
  city: "",
115
- province: "",
116
- zip: "",
115
+ state: "",
116
+ postalCode: "",
117
117
  country: "PL",
118
118
  phone: "",
119
119
  company: "",
@@ -179,12 +179,12 @@ function AddressFormFields({ prefix, values, onChange, errors }: AddressFormFiel
179
179
  </div>
180
180
 
181
181
  <div>
182
- <Label htmlFor={`${prefix}_address1`}>{t("address.address1")} *</Label>
182
+ <Label htmlFor={`${prefix}_address1`}>{t("address.streetLine1")} *</Label>
183
183
  <Input
184
184
  id={`${prefix}_address1`}
185
- placeholder={t("address.address1Placeholder")}
186
- value={values.address1}
187
- onChange={(e) => onChange("address1", e.target.value)}
185
+ placeholder={t("address.streetLine1Placeholder")}
186
+ value={values.streetLine1}
187
+ onChange={(e) => onChange("streetLine1", e.target.value)}
188
188
  className={errors[`${prefix}_address1`] ? "border-destructive" : ""}
189
189
  />
190
190
  {errors[`${prefix}_address1`] && (
@@ -193,22 +193,22 @@ function AddressFormFields({ prefix, values, onChange, errors }: AddressFormFiel
193
193
  </div>
194
194
 
195
195
  <div>
196
- <Label htmlFor={`${prefix}_address2`}>{t("address.address2")} ({tc("optional")})</Label>
196
+ <Label htmlFor={`${prefix}_address2`}>{t("address.streetLine2")} ({tc("optional")})</Label>
197
197
  <Input
198
198
  id={`${prefix}_address2`}
199
- value={values.address2}
200
- onChange={(e) => onChange("address2", e.target.value)}
199
+ value={values.streetLine2}
200
+ onChange={(e) => onChange("streetLine2", e.target.value)}
201
201
  />
202
202
  </div>
203
203
 
204
204
  <div className="grid gap-4 sm:grid-cols-2">
205
205
  <div>
206
- <Label htmlFor={`${prefix}_zip`}>{t("address.zip")} *</Label>
206
+ <Label htmlFor={`${prefix}_zip`}>{t("address.postalCode")} *</Label>
207
207
  <Input
208
208
  id={`${prefix}_zip`}
209
- placeholder={t("address.zipPlaceholder")}
210
- value={values.zip}
211
- onChange={(e) => onChange("zip", e.target.value)}
209
+ placeholder={t("address.postalCodePlaceholder")}
210
+ value={values.postalCode}
211
+ onChange={(e) => onChange("postalCode", e.target.value)}
212
212
  className={errors[`${prefix}_zip`] ? "border-destructive" : ""}
213
213
  />
214
214
  {errors[`${prefix}_zip`] && (
@@ -249,11 +249,11 @@ function AddressFormFields({ prefix, values, onChange, errors }: AddressFormFiel
249
249
  )}
250
250
  </div>
251
251
  <div>
252
- <Label htmlFor={`${prefix}_province`}>{t("address.province")} ({tc("optional")})</Label>
252
+ <Label htmlFor={`${prefix}_province`}>{t("address.state")} ({tc("optional")})</Label>
253
253
  <Input
254
254
  id={`${prefix}_province`}
255
- value={values.province}
256
- onChange={(e) => onChange("province", e.target.value)}
255
+ value={values.state}
256
+ onChange={(e) => onChange("state", e.target.value)}
257
257
  />
258
258
  </div>
259
259
  </div>
@@ -290,11 +290,11 @@ export default function CheckoutPage() {
290
290
  const addressSchema = z.object({
291
291
  firstName: z.string().min(1, t("validation.firstNameRequired")),
292
292
  lastName: z.string().min(1, t("validation.lastNameRequired")),
293
- address1: z.string().min(1, t("validation.addressRequired")),
294
- address2: z.string().optional(),
293
+ streetLine1: z.string().min(1, t("validation.addressRequired")),
294
+ streetLine2: z.string().optional(),
295
295
  city: z.string().min(1, t("validation.cityRequired")),
296
- province: z.string().optional(),
297
- zip: z.string().min(1, t("validation.zipRequired")),
296
+ state: z.string().optional(),
297
+ postalCode: z.string().min(1, t("validation.zipRequired")),
298
298
  country: z.string().min(2, t("validation.countryRequired")),
299
299
  phone: z.string().optional(),
300
300
  company: z.string().optional(),
@@ -359,7 +359,7 @@ export default function CheckoutPage() {
359
359
  // Sync discount codes from checkout (transferred from cart) to form state
360
360
  useEffect(() => {
361
361
  if ((checkout?.discountCodes?.length ?? 0) > 0 && !formState.appliedDiscountCode) {
362
- const applicableCode = checkout?.discountCodes?.find((dc) => dc.applicable);
362
+ const applicableCode = checkout?.discountCodes?.find((dc) => dc.isApplicable);
363
363
  if (applicableCode) {
364
364
  setFormState((prev) => ({
365
365
  ...prev,
@@ -1409,15 +1409,15 @@ export default function CheckoutPage() {
1409
1409
  <p className="text-sm text-muted-foreground">
1410
1410
  {checkout.shippingAddress.firstName} {checkout.shippingAddress.lastName}
1411
1411
  <br />
1412
- {checkout.shippingAddress.address1}
1413
- {checkout.shippingAddress.address2 && (
1412
+ {checkout.shippingAddress.streetLine1}
1413
+ {checkout.shippingAddress.streetLine2 && (
1414
1414
  <>
1415
1415
  <br />
1416
- {checkout.shippingAddress.address2}
1416
+ {checkout.shippingAddress.streetLine2}
1417
1417
  </>
1418
1418
  )}
1419
1419
  <br />
1420
- {checkout.shippingAddress.zip} {checkout.shippingAddress.city}
1420
+ {checkout.shippingAddress.postalCode} {checkout.shippingAddress.city}
1421
1421
  <br />
1422
1422
  {countries.find((c) => c.code === checkout.shippingAddress?.country)?.name ||
1423
1423
  checkout.shippingAddress.country}
@@ -1574,7 +1574,7 @@ export default function CheckoutPage() {
1574
1574
  )}
1575
1575
  </div>
1576
1576
  <p className="font-medium">
1577
- {formatPrice(item.totalPrice.amount)}
1577
+ {formatPrice(item.total.amount)}
1578
1578
  </p>
1579
1579
  </div>
1580
1580
  ))
@@ -1740,7 +1740,7 @@ export default function CheckoutPage() {
1740
1740
  <span className="text-muted-foreground">{tCart("products")}</span>
1741
1741
  <span>
1742
1742
  {formatPrice(
1743
- checkout?.subtotalPrice?.amount ||
1743
+ checkout?.cost?.subtotal?.amount ||
1744
1744
  items.reduce(
1745
1745
  (sum, item) => sum + parseFloat(item.price.amount) * item.quantity,
1746
1746
  0
@@ -1753,7 +1753,7 @@ export default function CheckoutPage() {
1753
1753
  {checkout?.shippingLine ? (
1754
1754
  <div className="flex justify-between text-sm">
1755
1755
  <span className="text-muted-foreground">{tCart("shipping")}</span>
1756
- <span>{formatPrice(checkout.totalShippingPrice?.amount || "0")}</span>
1756
+ <span>{formatPrice(checkout?.cost?.totalShipping?.amount || "0")}</span>
1757
1757
  </div>
1758
1758
  ) : (
1759
1759
  <div className="flex justify-between text-sm">
@@ -1763,18 +1763,18 @@ export default function CheckoutPage() {
1763
1763
  )}
1764
1764
 
1765
1765
  {/* Discount */}
1766
- {checkout?.totalDiscounts && parseFloat(checkout.totalDiscounts.amount) > 0 && (
1766
+ {checkout?.totalDiscounts && parseFloat(checkout?.cost?.totalDiscounts.amount) > 0 && (
1767
1767
  <div className="flex justify-between text-sm text-green-600">
1768
1768
  <span>{tCart("discount")}</span>
1769
- <span>-{formatPrice(checkout.totalDiscounts.amount)}</span>
1769
+ <span>-{formatPrice(checkout?.cost?.totalDiscounts.amount)}</span>
1770
1770
  </div>
1771
1771
  )}
1772
1772
 
1773
1773
  {/* Tax */}
1774
- {checkout?.totalTax && parseFloat(checkout.totalTax.amount) > 0 && (
1774
+ {checkout?.totalTax && parseFloat(checkout?.cost?.totalTax.amount) > 0 && (
1775
1775
  <div className="flex justify-between text-sm">
1776
1776
  <span className="text-muted-foreground">{tCart("tax")}</span>
1777
- <span>{formatPrice(checkout.totalTax.amount)}</span>
1777
+ <span>{formatPrice(checkout?.cost?.totalTax.amount)}</span>
1778
1778
  </div>
1779
1779
  )}
1780
1780
 
@@ -1791,7 +1791,7 @@ export default function CheckoutPage() {
1791
1791
  <span>{tCart("total")}</span>
1792
1792
  <span>
1793
1793
  {formatPrice(
1794
- checkout?.totalPrice?.amount ||
1794
+ checkout?.cost?.total?.amount ||
1795
1795
  items.reduce(
1796
1796
  (sum, item) => sum + parseFloat(item.price.amount) * item.quantity,
1797
1797
  0
@@ -1802,8 +1802,8 @@ export default function CheckoutPage() {
1802
1802
 
1803
1803
  {/* Payment Due (if different from total due to gift cards) */}
1804
1804
  {checkout?.paymentDue &&
1805
- checkout?.totalPrice &&
1806
- parseFloat(checkout.paymentDue.amount) !== parseFloat(checkout.totalPrice.amount) && (
1805
+ checkout?.cost?.total &&
1806
+ parseFloat(checkout.paymentDue.amount) !== parseFloat(checkout.cost.total.amount) && (
1807
1807
  <div className="flex justify-between border-t pt-2 text-lg font-bold text-primary">
1808
1808
  <span>{tCart("paymentDue")}</span>
1809
1809
  <span>{formatPrice(checkout.paymentDue.amount)}</span>
@@ -129,7 +129,7 @@ export function ProductClient({ product: initialProduct, similarProducts = [] }:
129
129
  [showConfigValidation],
130
130
  );
131
131
 
132
- // Live surcharge preview — doliczane do ceny wariantu na przycisku (jak Shopify Dynamic Checkout).
132
+ // Live surcharge preview — doliczane do ceny wariantu na przycisku (industry-standard dynamic checkout).
133
133
  const surcharge = useMemo(
134
134
  () => computeConfiguratorSurcharge(configuratorAttributes, configuratorSelections),
135
135
  [configuratorAttributes, configuratorSelections],
@@ -0,0 +1,6 @@
1
+ import { createWhoamiHandler } from '@doswiftly/storefront-sdk';
2
+
3
+ export const GET = createWhoamiHandler({
4
+ apiUrl: process.env.NEXT_PUBLIC_API_URL,
5
+ shopSlug: process.env.NEXT_PUBLIC_SHOP_SLUG,
6
+ });
@@ -11,11 +11,11 @@ export interface AddressFormData {
11
11
  firstName: string;
12
12
  lastName: string;
13
13
  company?: string;
14
- address1: string;
15
- address2?: string;
14
+ streetLine1: string;
15
+ streetLine2?: string;
16
16
  city: string;
17
- province: string;
18
- zip: string;
17
+ state: string;
18
+ postalCode: string;
19
19
  country: string;
20
20
  phone?: string;
21
21
  isDefault?: boolean;
@@ -48,11 +48,11 @@ export function AddressForm({
48
48
  firstName: "",
49
49
  lastName: "",
50
50
  company: "",
51
- address1: "",
52
- address2: "",
51
+ streetLine1: "",
52
+ streetLine2: "",
53
53
  city: "",
54
- province: "",
55
- zip: "",
54
+ state: "",
55
+ postalCode: "",
56
56
  country: "Poland",
57
57
  phone: "",
58
58
  isDefault: false,
@@ -78,17 +78,17 @@ export function AddressForm({
78
78
  if (!formData.lastName.trim()) {
79
79
  newErrors.lastName = t("validation.lastNameRequired");
80
80
  }
81
- if (!formData.address1.trim()) {
82
- newErrors.address1 = t("validation.addressRequired");
81
+ if (!formData.streetLine1.trim()) {
82
+ newErrors.streetLine1 = t("validation.addressRequired");
83
83
  }
84
84
  if (!formData.city.trim()) {
85
85
  newErrors.city = t("validation.cityRequired");
86
86
  }
87
- if (!formData.province.trim()) {
88
- newErrors.province = t("validation.provinceRequired");
87
+ if (!formData.state.trim()) {
88
+ newErrors.state = t("validation.provinceRequired");
89
89
  }
90
- if (!formData.zip.trim()) {
91
- newErrors.zip = t("validation.zipRequired");
90
+ if (!formData.postalCode.trim()) {
91
+ newErrors.postalCode = t("validation.zipRequired");
92
92
  }
93
93
  if (!formData.country.trim()) {
94
94
  newErrors.country = t("validation.countryRequired");
@@ -175,37 +175,37 @@ export function AddressForm({
175
175
  {/* Address 1 */}
176
176
  <div>
177
177
  <label
178
- htmlFor="address1"
178
+ htmlFor="streetLine1"
179
179
  className="block text-sm font-medium text-foreground mb-1"
180
180
  >
181
- {t("address.address1")} *
181
+ {t("address.streetLine1")} *
182
182
  </label>
183
183
  <Input
184
- id="address1"
184
+ id="streetLine1"
185
185
  type="text"
186
- value={formData.address1}
187
- onChange={(e) => handleChange("address1", e.target.value)}
186
+ value={formData.streetLine1}
187
+ onChange={(e) => handleChange("streetLine1", e.target.value)}
188
188
  disabled={isLoading}
189
- className={errors.address1 ? "border-red-500" : ""}
189
+ className={errors.streetLine1 ? "border-red-500" : ""}
190
190
  />
191
- {errors.address1 && (
192
- <p className="mt-1 text-sm text-red-600">{errors.address1}</p>
191
+ {errors.streetLine1 && (
192
+ <p className="mt-1 text-sm text-red-600">{errors.streetLine1}</p>
193
193
  )}
194
194
  </div>
195
195
 
196
196
  {/* Address 2 */}
197
197
  <div>
198
198
  <label
199
- htmlFor="address2"
199
+ htmlFor="streetLine2"
200
200
  className="block text-sm font-medium text-foreground mb-1"
201
201
  >
202
- {`${t("address.address2")} (${tc("optional")})`}
202
+ {`${t("address.streetLine2")} (${tc("optional")})`}
203
203
  </label>
204
204
  <Input
205
- id="address2"
205
+ id="streetLine2"
206
206
  type="text"
207
- value={formData.address2 || ""}
208
- onChange={(e) => handleChange("address2", e.target.value)}
207
+ value={formData.streetLine2 || ""}
208
+ onChange={(e) => handleChange("streetLine2", e.target.value)}
209
209
  disabled={isLoading}
210
210
  />
211
211
  </div>
@@ -235,42 +235,42 @@ export function AddressForm({
235
235
  {/* Province */}
236
236
  <div>
237
237
  <label
238
- htmlFor="province"
238
+ htmlFor="state"
239
239
  className="block text-sm font-medium text-foreground mb-1"
240
240
  >
241
- {t("address.province")} *
241
+ {t("address.state")} *
242
242
  </label>
243
243
  <Input
244
- id="province"
244
+ id="state"
245
245
  type="text"
246
- value={formData.province}
247
- onChange={(e) => handleChange("province", e.target.value)}
246
+ value={formData.state}
247
+ onChange={(e) => handleChange("state", e.target.value)}
248
248
  disabled={isLoading}
249
- className={errors.province ? "border-red-500" : ""}
249
+ className={errors.state ? "border-red-500" : ""}
250
250
  />
251
- {errors.province && (
252
- <p className="mt-1 text-sm text-red-600">{errors.province}</p>
251
+ {errors.state && (
252
+ <p className="mt-1 text-sm text-red-600">{errors.state}</p>
253
253
  )}
254
254
  </div>
255
255
 
256
256
  {/* Postal Code */}
257
257
  <div>
258
258
  <label
259
- htmlFor="zip"
259
+ htmlFor="postalCode"
260
260
  className="block text-sm font-medium text-foreground mb-1"
261
261
  >
262
- {t("address.zip")} *
262
+ {t("address.postalCode")} *
263
263
  </label>
264
264
  <Input
265
- id="zip"
265
+ id="postalCode"
266
266
  type="text"
267
- value={formData.zip}
268
- onChange={(e) => handleChange("zip", e.target.value)}
267
+ value={formData.postalCode}
268
+ onChange={(e) => handleChange("postalCode", e.target.value)}
269
269
  disabled={isLoading}
270
- className={errors.zip ? "border-red-500" : ""}
270
+ className={errors.postalCode ? "border-red-500" : ""}
271
271
  />
272
- {errors.zip && (
273
- <p className="mt-1 text-sm text-red-600">{errors.zip}</p>
272
+ {errors.postalCode && (
273
+ <p className="mt-1 text-sm text-red-600">{errors.postalCode}</p>
274
274
  )}
275
275
  </div>
276
276
  </div>
@@ -11,11 +11,11 @@ export interface Address {
11
11
  firstName: string;
12
12
  lastName: string;
13
13
  company?: string;
14
- address1: string;
15
- address2?: string;
14
+ streetLine1: string;
15
+ streetLine2?: string;
16
16
  city: string;
17
- province: string;
18
- zip: string;
17
+ state: string;
18
+ postalCode: string;
19
19
  country: string;
20
20
  phone?: string;
21
21
  isDefault: boolean;
@@ -45,7 +45,7 @@ export function AddressList({
45
45
 
46
46
  const handleDelete = (id: string, address: Address) => {
47
47
  if (
48
- confirm(t("deleteAddressConfirm", { address: address.address1 }))
48
+ confirm(t("deleteAddressConfirm", { address: address.streetLine1 }))
49
49
  ) {
50
50
  onDelete?.(id);
51
51
  }
@@ -114,12 +114,12 @@ export function AddressList({
114
114
  {address.company && (
115
115
  <p className="text-muted-foreground">{address.company}</p>
116
116
  )}
117
- <p className="text-muted-foreground">{address.address1}</p>
118
- {address.address2 && (
119
- <p className="text-muted-foreground">{address.address2}</p>
117
+ <p className="text-muted-foreground">{address.streetLine1}</p>
118
+ {address.streetLine2 && (
119
+ <p className="text-muted-foreground">{address.streetLine2}</p>
120
120
  )}
121
121
  <p className="text-muted-foreground">
122
- {address.city}, {address.province} {address.zip}
122
+ {address.city}, {address.state} {address.postalCode}
123
123
  </p>
124
124
  <p className="text-muted-foreground">{address.country}</p>
125
125
  {address.phone && (
@@ -14,7 +14,7 @@ fragment CustomerInfoFields on Customer {
14
14
  lastName
15
15
  displayName
16
16
  phone
17
- emailVerified
17
+ isEmailVerified
18
18
  ordersCount
19
19
  totalSpent {
20
20
  amount
@@ -24,11 +24,11 @@ fragment CustomerInfoFields on Customer {
24
24
  id
25
25
  firstName
26
26
  lastName
27
- address1
28
- address2
27
+ streetLine1
28
+ streetLine2
29
29
  city
30
- province
31
- zip
30
+ state
31
+ postalCode
32
32
  country
33
33
  phone
34
34
  }
@@ -20,11 +20,11 @@ export interface OrderAddress {
20
20
  firstName: string;
21
21
  lastName: string;
22
22
  company?: string;
23
- address1: string;
24
- address2?: string;
23
+ streetLine1: string;
24
+ streetLine2?: string;
25
25
  city: string;
26
- province: string;
27
- zip: string;
26
+ state: string;
27
+ postalCode: string;
28
28
  country: string;
29
29
  phone?: string;
30
30
  }
@@ -111,12 +111,12 @@ export function OrderDetails({ order, className }: OrderDetailsProps) {
111
111
  {address.company && (
112
112
  <p className="text-muted-foreground">{address.company}</p>
113
113
  )}
114
- <p className="text-muted-foreground">{address.address1}</p>
115
- {address.address2 && (
116
- <p className="text-muted-foreground">{address.address2}</p>
114
+ <p className="text-muted-foreground">{address.streetLine1}</p>
115
+ {address.streetLine2 && (
116
+ <p className="text-muted-foreground">{address.streetLine2}</p>
117
117
  )}
118
118
  <p className="text-muted-foreground">
119
- {address.city}, {address.province} {address.zip}
119
+ {address.city}, {address.state} {address.postalCode}
120
120
  </p>
121
121
  <p className="text-muted-foreground">{address.country}</p>
122
122
  {address.phone && (
@@ -97,7 +97,7 @@ export function OrderHistory({ orders, className }: OrderHistoryProps) {
97
97
  <div className="space-y-1 text-sm text-muted-foreground">
98
98
  <p>{t("placedOn")} {formatDate(order.processedAt)}</p>
99
99
  <p>
100
- {t("itemCount", { count: order.lineItemsCount })}
100
+ {t("itemCount", { count: order.itemCount })}
101
101
  </p>
102
102
  </div>
103
103
  </div>
@@ -105,7 +105,7 @@ export function OrderHistory({ orders, className }: OrderHistoryProps) {
105
105
  <div className="text-right">
106
106
  <p className="text-sm text-muted-foreground">{t("orderTotal")}</p>
107
107
  <p className="text-lg font-semibold text-foreground">
108
- {formatAmount(order.totalPrice.amount, order.totalPrice.currencyCode)}
108
+ {formatAmount(order.totals.total.amount, order.totals.total.currencyCode)}
109
109
  </p>
110
110
  </div>
111
111
  <ChevronRight className="h-5 w-5 text-muted-foreground" />
@@ -11,21 +11,23 @@ fragment OrderSummaryFields on Order {
11
11
  id
12
12
  orderNumber
13
13
  status
14
- financialStatus
14
+ paymentStatus
15
15
  fulfillmentStatus
16
16
  processedAt
17
- lineItemsCount
18
- totalPrice {
19
- amount
20
- currencyCode
21
- }
22
- subtotalPrice {
23
- amount
24
- currencyCode
25
- }
26
- totalShipping {
27
- amount
28
- currencyCode
17
+ itemCount
18
+ totals {
19
+ total {
20
+ amount
21
+ currencyCode
22
+ }
23
+ subtotal {
24
+ amount
25
+ currencyCode
26
+ }
27
+ totalShipping {
28
+ amount
29
+ currencyCode
30
+ }
29
31
  }
30
32
  shippingAddress {
31
33
  firstName