@sonic-commerce/storefront-types 0.36.1 → 0.38.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.
package/README.md CHANGED
@@ -116,6 +116,21 @@ const { data } = await api.GET("/carts/{id}", { params: { path: { id } } });
116
116
  const cart = data?.data as Cart | undefined; // shipping_total present
117
117
  ```
118
118
 
119
+ ### Product descriptions
120
+
121
+ `description` is a plain-text summary (max 500 characters). `body`, on the
122
+ product detail response only, is the detailed description as structured JSON —
123
+ see "Product descriptions" in the integrator's guide for the node types. Render
124
+ it as elements and text, never through `innerHTML`.
125
+
126
+ ### Stock by location
127
+
128
+ `GET /locations` lists the store's active locations (address, coordinates,
129
+ opening hours, pickup/delivery). On product detail each variant has
130
+ `locations: [{ location_id, quantity }]`, the stock at each one. `quantity` on
131
+ the variant is the store-wide total. See "Stock and locations" in the
132
+ integrator's guide.
133
+
119
134
  ## Versioning
120
135
 
121
136
  The package version tracks the API version: each version describes the `/v1`
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Generated by scripts/build.mjs from app/openapi/public-api.json — do not edit.
2
- // Spec version 0.36.1, 59 named schemas.
2
+ // Spec version 0.38.0, 60 named schemas.
3
3
 
4
4
  export type { paths, components, operations } from "./schema";
5
5
  import type { components } from "./schema";
@@ -25,6 +25,7 @@ export type CustomerAddress = components["schemas"]["CustomerAddress"];
25
25
  export type Error = components["schemas"]["Error"];
26
26
  export type ImageSizes = components["schemas"]["ImageSizes"];
27
27
  export type LineItem = components["schemas"]["LineItem"];
28
+ export type Location = components["schemas"]["Location"];
28
29
  export type LoginBody = components["schemas"]["LoginBody"];
29
30
  export type Order = components["schemas"]["Order"];
30
31
  export type OrderItem = components["schemas"]["OrderItem"];
package/dist/schema.d.ts CHANGED
@@ -1573,6 +1573,66 @@ export interface paths {
1573
1573
  patch?: never;
1574
1574
  trace?: never;
1575
1575
  };
1576
+ "/locations": {
1577
+ parameters: {
1578
+ query?: never;
1579
+ header?: never;
1580
+ path?: never;
1581
+ cookie?: never;
1582
+ };
1583
+ /**
1584
+ * List the store's locations
1585
+ * @description Active locations, the default (oldest) first — where a shopper can pick up or find stock. Product detail variants list stock per location by these ids.
1586
+ */
1587
+ get: {
1588
+ parameters: {
1589
+ query?: never;
1590
+ header?: never;
1591
+ path?: never;
1592
+ cookie?: never;
1593
+ };
1594
+ requestBody?: never;
1595
+ responses: {
1596
+ /** @description Success */
1597
+ 200: {
1598
+ headers: {
1599
+ [name: string]: unknown;
1600
+ };
1601
+ content: {
1602
+ "application/json": {
1603
+ data: components["schemas"]["Location"][];
1604
+ meta: components["schemas"]["PaginationMeta"];
1605
+ };
1606
+ };
1607
+ };
1608
+ /** @description Invalid request — unknown parameter or bad value. */
1609
+ 400: {
1610
+ headers: {
1611
+ [name: string]: unknown;
1612
+ };
1613
+ content: {
1614
+ "application/json": components["schemas"]["Error"];
1615
+ };
1616
+ };
1617
+ /** @description Rate limit exceeded. */
1618
+ 429: {
1619
+ headers: {
1620
+ [name: string]: unknown;
1621
+ };
1622
+ content: {
1623
+ "application/json": components["schemas"]["Error"];
1624
+ };
1625
+ };
1626
+ };
1627
+ };
1628
+ put?: never;
1629
+ post?: never;
1630
+ delete?: never;
1631
+ options?: never;
1632
+ head?: never;
1633
+ patch?: never;
1634
+ trace?: never;
1635
+ };
1576
1636
  "/tax-rate": {
1577
1637
  parameters: {
1578
1638
  query?: never;
@@ -3666,6 +3726,9 @@ export interface components {
3666
3726
  thumbnail_sizes?: components["schemas"]["ImageSizes"] | null;
3667
3727
  created_at?: string;
3668
3728
  updated_at?: string;
3729
+ body?: {
3730
+ [key: string]: unknown;
3731
+ }[] | null;
3669
3732
  variants?: components["schemas"]["ProductVariant"][];
3670
3733
  options?: components["schemas"]["ProductOption"][];
3671
3734
  categories?: components["schemas"]["ProductCategory"][];
@@ -3687,6 +3750,10 @@ export interface components {
3687
3750
  option_title: string;
3688
3751
  }[];
3689
3752
  prices: components["schemas"]["VariantPrice"][];
3753
+ locations?: {
3754
+ location_id: string;
3755
+ quantity: number;
3756
+ }[];
3690
3757
  };
3691
3758
  VariantPrice: {
3692
3759
  currency_code: string;
@@ -3847,6 +3914,26 @@ export interface components {
3847
3914
  code: string | null;
3848
3915
  rate: number;
3849
3916
  };
3917
+ Location: {
3918
+ id: string;
3919
+ name: string;
3920
+ address_line1: string | null;
3921
+ address_line2: string | null;
3922
+ city: string | null;
3923
+ state: string | null;
3924
+ postal_code: string | null;
3925
+ country_code: string | null;
3926
+ phone: string | null;
3927
+ email: string | null;
3928
+ latitude: number | null;
3929
+ longitude: number | null;
3930
+ timezone: string;
3931
+ opening_hours: {
3932
+ [key: string]: unknown;
3933
+ } | null;
3934
+ pickup_enabled: boolean;
3935
+ delivery_enabled: boolean;
3936
+ };
3850
3937
  TaxSummary: {
3851
3938
  region_id: string | null;
3852
3939
  label: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-commerce/storefront-types",
3
- "version": "0.36.1",
3
+ "version": "0.38.0",
4
4
  "description": "TypeScript types for the Sonic Commerce storefront API (/v1).",
5
5
  "keywords": ["sonic-commerce", "openapi", "types", "storefront"],
6
6
  "license": "UNLICENSED",